Author: cgutman
Date: Sat Sep 13 14:00:32 2008
New Revision: 36198
URL:
http://svn.reactos.org/svn/reactos?rev=36198&view=rev
Log:
- Call KeAcquireSpinLockAtDpcLevel instead of KeAcquireSpinLock when possible
- Don't hold the spin lock as long in MiniportDpc
Modified:
branches/aicom-network-fixes/drivers/network/ndis/ndis/efilter.c
branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c
branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c
Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/efilter.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/ndis/ndis/efilter.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/ndis/ndis/efilter.c [iso-8859-1] Sat Sep
13 14:00:32 2008
@@ -112,7 +112,6 @@
* Filter = Pointer to Ethernet filter
*/
{
- KIRQL OldIrql;
PLIST_ENTRY CurrentEntry;
PLOGICAL_ADAPTER Adapter;
PADAPTER_BINDING AdapterBinding;
@@ -124,7 +123,7 @@
Adapter = (PLOGICAL_ADAPTER)((PETHI_FILTER)Filter)->Miniport;
NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
- KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
+ KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock);
{
CurrentEntry = Adapter->ProtocolListHead.Flink;
@@ -138,7 +137,7 @@
CurrentEntry = CurrentEntry->Flink;
}
}
- KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
+ KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock);
}
/* EOF */
Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Sat Sep
13 14:00:32 2008
@@ -767,15 +767,16 @@
PVOID WorkItemContext;
NDIS_WORK_ITEM_TYPE WorkItemType;
PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(DeferredContext);
- KIRQL OldIrql;
NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
- KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
+ KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock);
NdisStatus =
MiniDequeueWorkItem
(Adapter, &WorkItemType, &WorkItemContext);
+
+ KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock);
if (NdisStatus == NDIS_STATUS_SUCCESS)
{
@@ -869,8 +870,6 @@
break;
}
}
-
- KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
}
Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Sat Sep
13 14:00:32 2008
@@ -63,7 +63,6 @@
* - XXX ATM, this only handles loopback packets - is that its designed function?
*/
{
- KIRQL OldIrql;
UINT BufferedLength;
UINT PacketLength;
@@ -76,12 +75,12 @@
NdisQueryPacket(Packet, NULL, NULL, NULL, &PacketLength);
NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
- KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
+ KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock);
{
Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()] =
Packet;
BufferedLength = CopyPacketToBuffer(Adapter->LookaheadBuffer, Packet, 0,
Adapter->NdisMiniportBlock.CurrentLookahead);
}
- KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
+ KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock);
if (BufferedLength > Adapter->MediumHeaderSize)
{
@@ -96,11 +95,11 @@
}
NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n"));
- KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
+ KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock);
{
Adapter->NdisMiniportBlock.IndicatedPacket[KeGetCurrentProcessorNumber()] =
NULL;
}
- KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
+ KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock);
return STATUS_SUCCESS;
}