reactos/drivers/net/ndis/ndis
diff -u -r1.44 -r1.45
--- miniport.c 30 Nov 2004 04:23:42 -0000 1.44
+++ miniport.c 1 Dec 2004 08:02:28 -0000 1.45
@@ -627,6 +627,7 @@
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
ASSERT(Adapter);
+ ASSERT(KeGetCurrentIrql() >= DISPATCH_LEVEL);
#if 0
if (Adapter->WorkQueueLevel < NDIS_MINIPORT_WORK_QUEUE_SIZE - 1)
@@ -756,6 +757,24 @@
}
+#undef NdisMQueryInformationComplete
+/*
+ * @implemented
+ */
+VOID
+EXPORT
+NdisMQueryInformationComplete(
+ IN NDIS_HANDLE MiniportAdapterHandle,
+ IN NDIS_STATUS Status)
+{
+ PNDIS_MINIPORT_BLOCK MiniportBlock =
+ (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle;
+ ASSERT(MiniportBlock);
+ if( MiniportBlock->QueryCompleteHandler )
+ (MiniportBlock->QueryCompleteHandler)(MiniportAdapterHandle, Status);
+}
+
+
VOID STDCALL MiniportDpc(
IN PKDPC Dpc,
IN PVOID DeferredContext,
@@ -777,7 +796,6 @@
NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
- /* XXX is adapter lock held here? should be... */
NdisStatus = MiniDequeueWorkItem(Adapter, &WorkItemType, &WorkItemContext);
if (NdisStatus == NDIS_STATUS_SUCCESS)
@@ -853,7 +871,7 @@
switch (((PNDIS_REQUEST)WorkItemContext)->RequestType)
{
case NdisRequestQueryInformation:
- NdisMQueryInformationComplete((NDIS_HANDLE)Adapter, NdisStatus);
+ NdisMQueryInformationComplete((NDIS_HANDLE)Adapter, NdisStatus);
break;
case NdisRequestSetInformation:
@@ -1046,21 +1064,6 @@
*NdisWrapperHandle = Miniport;
}
-#undef NdisMQueryInformationComplete
-
-
-/*
- * @implemented
- */
-VOID
-EXPORT
-NdisMQueryInformationComplete(
- IN NDIS_HANDLE MiniportAdapterHandle,
- IN NDIS_STATUS Status)
-{
- (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->QueryCompleteHandler)(MiniportAdapterHandle, Status);
-}
-
VOID STDCALL NdisIBugcheckCallback(
IN PVOID Buffer,
reactos/drivers/net/ndis/ndis
diff -u -r1.22 -r1.23
--- protocol.c 23 Nov 2004 18:58:47 -0000 1.22
+++ protocol.c 1 Dec 2004 08:02:28 -0000 1.23
@@ -147,14 +147,16 @@
Adapter->MiniportBusy = TRUE;
}
}
- KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
+ /* MiniQueueWorkItem must be called at IRQL >= DISPATCH_LEVEL */
if (QueueWorkItem)
{
MiniQueueWorkItem(Adapter, NdisWorkItemRequest, (PVOID)NdisRequest);
return NDIS_STATUS_PENDING;
}
+ KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
+
/* MiniportQueryInformation (called by MiniDoRequest) runs at DISPATCH_LEVEL */
/* TODO (?): move the irql raise into MiniDoRequest */
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);