Author: cgutman
Date: Sat Sep 27 13:00:08 2008
New Revision: 36551
URL:
http://svn.reactos.org/svn/reactos?rev=36551&view=rev
Log:
- Queue a work item in MiniReset if the adapter is currently busy
- Handle NdisWorkItemResetRequested in MiniportWorker
- Remove a fixme
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
27 13:00:08 2008
@@ -619,14 +619,18 @@
* Status of the operation
*/
{
- NDIS_STATUS Status = NDIS_STATUS_FAILURE;
+ NDIS_STATUS Status;
KIRQL OldIrql;
- /* FIXME: What should we return if there isn't a reset handler? */
+ if (Adapter->MiniportBusy) {
+ KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
+ MiniQueueWorkItem(Adapter, NdisWorkItemResetRequested, NULL);
+ KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
+ return NDIS_STATUS_PENDING;
+ }
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
- if
(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.ResetHandler)
- Status =
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.ResetHandler)(
+ Status =
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.ResetHandler)(
Adapter->NdisMiniportBlock.MiniportAdapterContext,
AddressingReset);
KeLowerIrql(OldIrql);
@@ -841,6 +845,7 @@
NDIS_STATUS NdisStatus;
PVOID WorkItemContext;
NDIS_WORK_ITEM_TYPE WorkItemType;
+ BOOLEAN AddressingReset;
KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql);
@@ -938,6 +943,12 @@
break;
case NdisWorkItemResetRequested:
+ NdisStatus = MiniReset(Adapter, &AddressingReset);
+
+ if (NdisStatus == NDIS_STATUS_PENDING)
+ break;
+
+ MiniResetComplete(Adapter, NdisStatus, AddressingReset);
break;
case NdisWorkItemResetInProgress: