Author: cgutman
Date: Sun Sep 14 00:30:06 2008
New Revision: 36212
URL:
http://svn.reactos.org/svn/reactos?rev=36212&view=rev
Log:
- Call a serialized miniport's Send/SendPackets handler at DISPATCH_LEVEL
Modified:
branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c
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] Sun Sep
14 00:30:06 2008
@@ -752,7 +752,7 @@
{
PNDIS_WORK_ITEM NdisWorkItem = WorkItem;
PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(NdisWorkItem->Context);
- KIRQL OldIrql;
+ KIRQL OldIrql, RaiseOldIrql;
NDIS_STATUS NdisStatus;
PVOID WorkItemContext;
NDIS_WORK_ITEM_TYPE WorkItemType;
@@ -778,27 +778,45 @@
#endif
if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)
{
- NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's SendPackets
handler\n"));
-
- /*
- * XXX assumes single-packet - prolly OK since we'll call something
- * different on multi-packet sends
- */
-
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)(
- Adapter->NdisMiniportBlock.MiniportAdapterContext,
(PPNDIS_PACKET)&WorkItemContext, 1);
- NdisStatus =
- NDIS_GET_PACKET_STATUS((PNDIS_PACKET)WorkItemContext);
-
- NDIS_DbgPrint(MAX_TRACE, ("back from miniport's SendPackets
handler\n"));
+ if(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_DESERIALIZE)
+ {
+ NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's SendPackets
handler\n"));
+
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)(
+ Adapter->NdisMiniportBlock.MiniportAdapterContext,
(PPNDIS_PACKET)&WorkItemContext, 1);
+ }
+ else
+ {
+ /* SendPackets is called at DISPATCH_LEVEL for all serialized
miniports */
+ KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql);
+ {
+ NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's SendPackets
handler\n"));
+
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)(
+ Adapter->NdisMiniportBlock.MiniportAdapterContext,
(PPNDIS_PACKET)&WorkItemContext, 1);
+ }
+ KeLowerIrql(RaiseOldIrql);
+ }
+
+ NdisStatus = NDIS_GET_PACKET_STATUS((PNDIS_PACKET)WorkItemContext);
}
else
{
- NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send
handler\n"));
-
- NdisStatus =
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
- Adapter->NdisMiniportBlock.MiniportAdapterContext,
(PNDIS_PACKET)WorkItemContext, 0);
-
- NDIS_DbgPrint(MAX_TRACE, ("back from miniport's Send
handler\n"));
+ if(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_DESERIALIZE)
+ {
+ NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send
handler\n"));
+ NdisStatus =
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
+ Adapter->NdisMiniportBlock.MiniportAdapterContext,
(PNDIS_PACKET)WorkItemContext, 0);
+ NDIS_DbgPrint(MAX_TRACE, ("back from miniport's send
handler\n"));
+ }
+ else
+ {
+ /* Send is called at DISPATCH_LEVEL for all serialized miniports */
+ KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql);
+ NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send
handler\n"));
+ NdisStatus =
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
+ Adapter->NdisMiniportBlock.MiniportAdapterContext,
(PNDIS_PACKET)WorkItemContext, 0);
+ NDIS_DbgPrint(MAX_TRACE, ("back from miniport's send
handler\n"));
+ KeLowerIrql(RaiseOldIrql);
+ }
}
if( NdisStatus != NDIS_STATUS_PENDING ) {
NdisMSendComplete