- Call a serialized miniport's Send/SendPackets handler at DISPATCH_LEVEL

svn path=/branches/aicom-network-fixes/; revision=36212
This commit is contained in:
Cameron Gutman 2008-09-14 05:30:06 +00:00
parent 91ac8bce6e
commit 3c6651a64e

View file

@ -752,7 +752,7 @@ VOID NTAPI MiniportWorker(IN PVOID WorkItem)
{ {
PNDIS_WORK_ITEM NdisWorkItem = WorkItem; PNDIS_WORK_ITEM NdisWorkItem = WorkItem;
PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(NdisWorkItem->Context); PLOGICAL_ADAPTER Adapter = GET_LOGICAL_ADAPTER(NdisWorkItem->Context);
KIRQL OldIrql; KIRQL OldIrql, RaiseOldIrql;
NDIS_STATUS NdisStatus; NDIS_STATUS NdisStatus;
PVOID WorkItemContext; PVOID WorkItemContext;
NDIS_WORK_ITEM_TYPE WorkItemType; NDIS_WORK_ITEM_TYPE WorkItemType;
@ -778,27 +778,45 @@ VOID NTAPI MiniportWorker(IN PVOID WorkItem)
#endif #endif
if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler) if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)
{ {
NDIS_DbgPrint(MAX_TRACE, ("Calling 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);
* 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"));
} }
else else
{ {
NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send handler\n")); if(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_DESERIALIZE)
{
NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)( NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's Send handler\n"));
Adapter->NdisMiniportBlock.MiniportAdapterContext, (PNDIS_PACKET)WorkItemContext, 0); NdisStatus = (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
Adapter->NdisMiniportBlock.MiniportAdapterContext, (PNDIS_PACKET)WorkItemContext, 0);
NDIS_DbgPrint(MAX_TRACE, ("back from miniport's Send handler\n")); 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 ) { if( NdisStatus != NDIS_STATUS_PENDING ) {
NdisMSendComplete NdisMSendComplete