Author: cgutman
Date: Sat Oct 18 20:30:07 2008
New Revision: 36821
URL:
http://svn.reactos.org/svn/reactos?rev=36821&view=rev
Log:
- Implement ProSendPackets (NdisSendPackets)
Modified:
branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c
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 Oct
18 20:30:07 2008
@@ -296,7 +296,66 @@
IN PPNDIS_PACKET PacketArray,
IN UINT NumberOfPackets)
{
- UNIMPLEMENTED
+ PADAPTER_BINDING AdapterBinding = NdisBindingHandle;
+ PLOGICAL_ADAPTER Adapter = AdapterBinding->Adapter;
+ KIRQL RaiseOldIrql;
+ NDIS_STATUS NdisStatus;
+ UINT i;
+
+
if(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)
+ {
+ if(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_DESERIALIZE)
+ {
+
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)(
+ Adapter->NdisMiniportBlock.MiniportAdapterContext, PacketArray,
NumberOfPackets);
+ for (i = 0; i < NumberOfPackets; i++)
+ {
+ NdisStatus = NDIS_GET_PACKET_STATUS(PacketArray[i]);
+ if (NdisStatus != NDIS_STATUS_PENDING)
+ MiniSendComplete(Adapter, PacketArray[i], NdisStatus);
+ }
+ }
+ else
+ {
+ /* SendPackets is called at DISPATCH_LEVEL for all serialized miniports */
+ KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql);
+
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)(
+ Adapter->NdisMiniportBlock.MiniportAdapterContext, PacketArray,
NumberOfPackets);
+ KeLowerIrql(RaiseOldIrql);
+ for (i = 0; i < NumberOfPackets; i++)
+ {
+ NdisStatus = NDIS_GET_PACKET_STATUS(PacketArray[i]);
+ if (NdisStatus != NDIS_STATUS_PENDING)
+ MiniSendComplete(Adapter, PacketArray[i], NdisStatus);
+ }
+ }
+ }
+ else
+ {
+ if(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_DESERIALIZE)
+ {
+ for (i = 0; i < NumberOfPackets; i++)
+ {
+ NdisStatus =
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
+ Adapter->NdisMiniportBlock.MiniportAdapterContext,
PacketArray[i], 0);
+ if (NdisStatus != NDIS_STATUS_PENDING)
+ MiniSendComplete(Adapter, PacketArray[i], NdisStatus);
+ }
+ }
+ else
+ {
+ /* Send is called at DISPATCH_LEVEL for all serialized miniports */
+ KeRaiseIrql(DISPATCH_LEVEL, &RaiseOldIrql);
+ for (i = 0; i < NumberOfPackets; i++)
+ {
+ NdisStatus =
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendHandler)(
+ Adapter->NdisMiniportBlock.MiniportAdapterContext,
PacketArray[i], 0);
+ if (NdisStatus != NDIS_STATUS_PENDING)
+ MiniSendComplete(Adapter, PacketArray[i], NdisStatus);
+ }
+ KeLowerIrql(RaiseOldIrql);
+ }
+ }
}