mirror of
https://github.com/reactos/reactos.git
synced 2024-08-03 01:50:57 +00:00
- Limit the number of interrupts that are handled per call to MiniportHandleInterrupt to prevent us from staying at DISPATCH_LEVEL for too long
svn path=/trunk/; revision=43693
This commit is contained in:
parent
0fba4d8f11
commit
612660aeee
|
@ -55,7 +55,8 @@
|
||||||
/* Interrupt Mask Register value */
|
/* Interrupt Mask Register value */
|
||||||
#define DRIVER_INTERRUPT_MASK IMR_ALLE - IMR_RDCE
|
#define DRIVER_INTERRUPT_MASK IMR_ALLE - IMR_RDCE
|
||||||
|
|
||||||
|
/* Maximum number of interrupts handled per call to MiniportHandleInterrupt */
|
||||||
|
#define INTERRUPT_LIMIT 10
|
||||||
|
|
||||||
/* Global structures */
|
/* Global structures */
|
||||||
|
|
||||||
|
|
|
@ -1315,6 +1315,7 @@ VOID NTAPI MiniportHandleInterrupt(
|
||||||
UCHAR ISRMask;
|
UCHAR ISRMask;
|
||||||
UCHAR Mask;
|
UCHAR Mask;
|
||||||
PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
|
PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
|
||||||
|
UINT i = 0;
|
||||||
|
|
||||||
ISRMask = Adapter->InterruptMask;
|
ISRMask = Adapter->InterruptMask;
|
||||||
NdisRawReadPortUchar(Adapter->IOBase + PG0_ISR, &ISRValue);
|
NdisRawReadPortUchar(Adapter->IOBase + PG0_ISR, &ISRValue);
|
||||||
|
@ -1323,12 +1324,14 @@ VOID NTAPI MiniportHandleInterrupt(
|
||||||
|
|
||||||
Adapter->InterruptStatus |= (ISRValue & ISRMask);
|
Adapter->InterruptStatus |= (ISRValue & ISRMask);
|
||||||
|
|
||||||
if (ISRValue != 0x00)
|
|
||||||
/* Acknowledge interrupts */
|
|
||||||
NdisRawWritePortUchar(Adapter->IOBase + PG0_ISR, ISRValue);
|
|
||||||
|
|
||||||
Mask = 0x01;
|
Mask = 0x01;
|
||||||
while (Adapter->InterruptStatus != 0x00) {
|
while (Adapter->InterruptStatus != 0x00 && i++ < INTERRUPT_LIMIT) {
|
||||||
|
|
||||||
|
if (ISRValue != 0x00) {
|
||||||
|
/* Acknowledge interrupts */
|
||||||
|
NdisRawWritePortUchar(Adapter->IOBase + PG0_ISR, ISRValue);
|
||||||
|
Mask = 0x01;
|
||||||
|
}
|
||||||
|
|
||||||
NDIS_DbgPrint(MID_TRACE, ("Adapter->InterruptStatus (0x%X) Mask (0x%X).\n",
|
NDIS_DbgPrint(MID_TRACE, ("Adapter->InterruptStatus (0x%X) Mask (0x%X).\n",
|
||||||
Adapter->InterruptStatus, Mask));
|
Adapter->InterruptStatus, Mask));
|
||||||
|
@ -1409,12 +1412,6 @@ VOID NTAPI MiniportHandleInterrupt(
|
||||||
NDIS_DbgPrint(MID_TRACE, ("ISRValue (0x%X).\n", ISRValue));
|
NDIS_DbgPrint(MID_TRACE, ("ISRValue (0x%X).\n", ISRValue));
|
||||||
|
|
||||||
Adapter->InterruptStatus |= (ISRValue & ISRMask);
|
Adapter->InterruptStatus |= (ISRValue & ISRMask);
|
||||||
|
|
||||||
if (ISRValue != 0x00) {
|
|
||||||
/* Acknowledge interrupts */
|
|
||||||
NdisRawWritePortUchar(Adapter->IOBase + PG0_ISR, ISRValue);
|
|
||||||
Mask = 0x01;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NICEnableInterrupts((PNIC_ADAPTER)MiniportAdapterContext);
|
NICEnableInterrupts((PNIC_ADAPTER)MiniportAdapterContext);
|
||||||
|
|
|
@ -66,6 +66,7 @@ MiniportHandleInterrupt(
|
||||||
{
|
{
|
||||||
PADAPTER Adapter = (PADAPTER)MiniportAdapterContext;
|
PADAPTER Adapter = (PADAPTER)MiniportAdapterContext;
|
||||||
USHORT Data;
|
USHORT Data;
|
||||||
|
UINT i = 0;
|
||||||
|
|
||||||
DPRINT("Called\n");
|
DPRINT("Called\n");
|
||||||
|
|
||||||
|
@ -78,7 +79,7 @@ MiniportHandleInterrupt(
|
||||||
|
|
||||||
DPRINT("CSR0 is 0x%x\n", Data);
|
DPRINT("CSR0 is 0x%x\n", Data);
|
||||||
|
|
||||||
while(Data & CSR0_INTR)
|
while((Data & CSR0_INTR) && i++ < INTERRUPT_LIMIT)
|
||||||
{
|
{
|
||||||
/* Clear interrupt flags early to avoid race conditions. */
|
/* Clear interrupt flags early to avoid race conditions. */
|
||||||
NdisRawWritePortUshort(Adapter->PortOffset + RDP, Data);
|
NdisRawWritePortUshort(Adapter->PortOffset + RDP, Data);
|
||||||
|
|
|
@ -149,6 +149,9 @@ MiGetMediaDuplex(PADAPTER Adapter);
|
||||||
/* flags */
|
/* flags */
|
||||||
#define RESET_IN_PROGRESS 0x1
|
#define RESET_IN_PROGRESS 0x1
|
||||||
|
|
||||||
|
/* Maximum number of interrupts handled per call to MiniportHandleInterrupt */
|
||||||
|
#define INTERRUPT_LIMIT 10
|
||||||
|
|
||||||
#if DBG
|
#if DBG
|
||||||
#define BREAKPOINT DbgBreakPoint();
|
#define BREAKPOINT DbgBreakPoint();
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue