Author: cgutman
Date: Sat Sep 20 21:35:23 2008
New Revision: 36363
URL:
http://svn.reactos.org/svn/reactos?rev=36363&view=rev
Log:
- Set MiniportBusy to TRUE in MiniDequeueWorkItem instead of MiniQueueWorkItem
- Fail if another miniport request is still in progress
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] Sat Sep
20 21:35:23 2008
@@ -634,8 +634,6 @@
KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL);
- Adapter->MiniportBusy = TRUE;
-
return NDIS_STATUS_SUCCESS;
}
@@ -663,6 +661,12 @@
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
+ if (Adapter->MiniportBusy) {
+ NDIS_DbgPrint(MID_TRACE, ("Waiting for miniport to become free.\n"));
+ KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL);
+ return NDIS_STATUS_FAILURE;
+ }
+
Item = Adapter->WorkQueueHead;
if (Item)
@@ -677,6 +681,8 @@
*WorkItemContext = Item->WorkItemContext;
ExFreePool(Item);
+
+ Adapter->MiniportBusy = TRUE;
return NDIS_STATUS_SUCCESS;
}
@@ -900,6 +906,9 @@
}
}
+ if( NdisStatus != NDIS_STATUS_PENDING )
+ Adapter->MiniportBusy = FALSE;
+
ExFreePool(WorkItem);
}