Author: cgutman
Date: Thu Oct 2 04:42:08 2008
New Revision: 36622
URL:
http://svn.reactos.org/svn/reactos?rev=36622&view=rev
Log:
- Merge aicom-network-fixes up to r36621
Modified:
trunk/reactos/drivers/network/ndis/ndis/hardware.c
trunk/reactos/drivers/network/ndis/ndis/io.c
Modified: trunk/reactos/drivers/network/ndis/ndis/hardware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/hardware.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/hardware.c [iso-8859-1] Thu Oct 2 04:42:08
2008
@@ -57,20 +57,20 @@
NDIS_STATUS
EXPORT
NdisMPciAssignResources(
- IN NDIS_HANDLE MiniportHandle,
+ IN NDIS_HANDLE MiniportAdapterHandle,
IN ULONG SlotNumber,
OUT PNDIS_RESOURCE_LIST *AssignedResources)
{
- PNDIS_MINIPORT_BLOCK MiniportBlock = (PNDIS_MINIPORT_BLOCK)MiniportHandle;
-
- if (MiniportBlock->BusType != PCIBus ||
- MiniportBlock->AllocatedResources == NULL)
+ PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle;
+
+ if (Adapter->NdisMiniportBlock.BusType != PCIBus ||
+ Adapter->NdisMiniportBlock.AllocatedResources == NULL)
{
*AssignedResources = NULL;
return NDIS_STATUS_FAILURE;
}
- *AssignedResources =
&MiniportBlock->AllocatedResources->List[0].PartialResourceList;
+ *AssignedResources =
&Adapter->NdisMiniportBlock.AllocatedResources->List[0].PartialResourceList;
return NDIS_STATUS_SUCCESS;
}
@@ -99,7 +99,7 @@
*/
{
PNDIS_WRAPPER_CONTEXT WrapperContext =
(PNDIS_WRAPPER_CONTEXT)WrapperConfigurationContext;
- PNDIS_MINIPORT_BLOCK MiniportBlock =
WrapperContext->DeviceObject->DeviceExtension;
+ PLOGICAL_ADAPTER Adapter = WrapperContext->DeviceObject->DeviceExtension;
ULONG ResourceListSize;
PAGED_CODE();
@@ -107,7 +107,7 @@
NDIS_DbgPrint(MAX_TRACE, ("Called\n"));
- if (MiniportBlock->AllocatedResources == NULL)
+ if (Adapter->NdisMiniportBlock.AllocatedResources == NULL)
{
NDIS_DbgPrint(MIN_TRACE, ("No allocated resources!\n"));
*Status = NDIS_STATUS_FAILURE;
@@ -116,13 +116,13 @@
ResourceListSize =
FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) +
- MiniportBlock->AllocatedResources->List[0].PartialResourceList.Count *
+
Adapter->NdisMiniportBlock.AllocatedResources->List[0].PartialResourceList.Count *
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
if (*BufferSize >= ResourceListSize)
{
RtlCopyMemory(ResourceList,
-
&MiniportBlock->AllocatedResources->List[0].PartialResourceList,
+
&Adapter->NdisMiniportBlock.AllocatedResources->List[0].PartialResourceList,
ResourceListSize);
*BufferSize = ResourceListSize;
*Status = NDIS_STATUS_SUCCESS;
@@ -196,10 +196,10 @@
IN PVOID Buffer,
IN ULONG Length)
{
- PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)NdisAdapterHandle;
+ PLOGICAL_ADAPTER Adapter = NdisAdapterHandle;
/* Slot number is ignored since W2K for all NDIS drivers. */
return HalGetBusDataByOffset(PCIConfiguration,
- Adapter->BusNumber, Adapter->SlotNumber,
+ Adapter->NdisMiniportBlock.BusNumber,
Adapter->NdisMiniportBlock.SlotNumber,
Buffer, Offset, Length);
}
@@ -216,10 +216,10 @@
IN PVOID Buffer,
IN ULONG Length)
{
- PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)NdisAdapterHandle;
+ PLOGICAL_ADAPTER Adapter = NdisAdapterHandle;
/* Slot number is ignored since W2K for all NDIS drivers. */
return HalSetBusDataByOffset(PCIConfiguration,
- Adapter->BusNumber, Adapter->SlotNumber,
+ Adapter->NdisMiniportBlock.BusNumber,
Adapter->NdisMiniportBlock.SlotNumber,
Buffer, Offset, Length);
}
Modified: trunk/reactos/drivers/network/ndis/ndis/io.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] Thu Oct 2 04:42:08 2008
@@ -60,22 +60,31 @@
* TRUE if a miniport controlled device generated the interrupt
*/
{
- BOOLEAN InterruptRecognized;
- BOOLEAN QueueMiniportHandleInterrupt;
- PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)ServiceContext;
+ BOOLEAN InterruptRecognized = FALSE;
+ BOOLEAN QueueMiniportHandleInterrupt = FALSE;
+ PLOGICAL_ADAPTER Adapter = ServiceContext;
NDIS_DbgPrint(MAX_TRACE, ("Called. Adapter (0x%X)\n", Adapter));
- (*Adapter->DriverHandle->MiniportCharacteristics.ISRHandler)(
- &InterruptRecognized,
- &QueueMiniportHandleInterrupt,
- Adapter->MiniportAdapterContext);
+ if (Adapter->NdisMiniportBlock.Interrupt->IsrRequested) {
+
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.ISRHandler)(
+ &InterruptRecognized,
+ &QueueMiniportHandleInterrupt,
+ Adapter->NdisMiniportBlock.MiniportAdapterContext);
+
+ } else if
(Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.DisableInterruptHandler)
{
+
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.DisableInterruptHandler)(
+ Adapter->NdisMiniportBlock.MiniportAdapterContext);
+ QueueMiniportHandleInterrupt = TRUE;
+ InterruptRecognized = TRUE;
+ }
+
if (QueueMiniportHandleInterrupt)
- {
- NDIS_DbgPrint(MAX_TRACE, ("Queueing DPC.\n"));
- KeInsertQueueDpc(&Adapter->Interrupt->InterruptDpc, NULL, NULL);
- }
+ {
+ NDIS_DbgPrint(MAX_TRACE, ("Queuing DPC.\n"));
+ KeInsertQueueDpc(&Adapter->NdisMiniportBlock.Interrupt->InterruptDpc,
NULL, NULL);
+ }
NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n"));
@@ -207,15 +216,15 @@
* - Called at IRQL = DISPATCH_LEVEL
*/
{
- PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)Context;
-
- NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
-
- Adapter->MapRegisters[Adapter->CurrentMapRegister].MapRegister =
MapRegisterBase;
+ PLOGICAL_ADAPTER Adapter = Context;
+
+ NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
+
+
Adapter->NdisMiniportBlock.MapRegisters[Adapter->NdisMiniportBlock.CurrentMapRegister].MapRegister
= MapRegisterBase;
NDIS_DbgPrint(MAX_TRACE, ("setting event and leaving.\n"));
- KeSetEvent(Adapter->AllocationEvent, 0, FALSE);
+ KeSetEvent(Adapter->NdisMiniportBlock.AllocationEvent, 0, FALSE);
/* this is only the thing to do for busmaster NICs */
return DeallocateObjectKeepRegisters;
@@ -767,6 +776,7 @@
KeInitializeEvent(&Interrupt->DpcsCompletedEvent, NotificationEvent, FALSE);
Interrupt->SharedInterrupt = SharedInterrupt;
+ Interrupt->IsrRequested = RequestIsr;
Adapter->NdisMiniportBlock.Interrupt = Interrupt;