1742
1742
b = !pContext->NetSendQueue->vq_ops->restart(pContext->NetSendQueue);
1744
ParaNdis_DebugHistory(pContext, hopDPC, (PVOID)0x20, SyncContext->Parameter, !b, 0);
1746
1747
/**********************************************************
1753
1754
ULONG stillRequiresProcessing = 0;
1754
1755
ULONG interruptSources;
1755
1756
DEBUG_ENTRY(5);
1756
ParaNdis_DebugHistory(pContext, hopDPC, (PVOID)1, 0, 0, 0);
1757
1757
if (pContext->bEnableInterruptHandlingDPC)
1759
1759
InterlockedIncrement(&pContext->counterDPCInside);
1762
1762
InterlockedExchange(&pContext->bDPCInactive, 0);
1763
1763
interruptSources = InterlockedExchange(&pContext->InterruptStatus, 0);
1764
ParaNdis_DebugHistory(pContext, hopDPC, (PVOID)1, interruptSources, 0, 0);
1764
1765
if ((interruptSources & isControl) && pContext->bLinkDetectSupported)
1766
1767
ParaNdis_ReportLinkStatus(pContext);
1772
1773
if (interruptSources & isReceive)
1774
int nRestartResult = 2, nLoop = 0;
1775
while (nRestartResult)
1775
int nRestartResult = 0, nLoop = 0;
1778
1779
LONG rxActive = InterlockedIncrement(&pContext->dpcReceiveActive);
1783
1784
NdisAcquireSpinLock(&pContext->ReceiveLock);
1784
1785
nRestartResult = ParaNdis_SynchronizeWithInterrupt(
1785
1786
pContext, pContext->ulRxMessage, RestartQueueSynchronously, isReceive);
1787
ParaNdis_DebugHistory(pContext, hopDPC, (PVOID)3, nRestartResult, 0, 0);
1786
1788
NdisReleaseSpinLock(&pContext->ReceiveLock);
1787
1789
DPrintf(nRestartResult ? 2 : 6, ("[%s] queue restarted%s", __FUNCTION__, nRestartResult ? "(Rerun)" : "(Done)"));
1789
1791
if (nLoop > MAX_RX_LOOPS)
1791
1793
DPrintf(0, ("[%s] Breaking Rx loop on %d-th operation", __FUNCTION__, nLoop));
1794
ParaNdis_DebugHistory(pContext, hopDPC, (PVOID)4, nRestartResult, 0, 0);
1797
1800
InterlockedDecrement(&pContext->dpcReceiveActive);
1801
if (!nRestartResult)
1803
NdisAcquireSpinLock(&pContext->ReceiveLock);
1804
nRestartResult = ParaNdis_SynchronizeWithInterrupt(
1805
pContext, pContext->ulRxMessage, RestartQueueSynchronously, isReceive);
1806
ParaNdis_DebugHistory(pContext, hopDPC, (PVOID)5, nRestartResult, 0, 0);
1807
NdisReleaseSpinLock(&pContext->ReceiveLock);
1799
1809
DPrintf(1, ("[%s] Skip Rx processing no.%d", __FUNCTION__, rxActive));
1812
} while (nRestartResult);
1802
1814
if (nRestartResult) stillRequiresProcessing |= isReceive;
1878
1890
// todo - collect more and put out optionally
1879
1891
PrintStatistics(pContext);
1894
if (pContext->Statistics.ifHCInOctets == pContext->Counters.prevIn)
1896
pContext->Counters.nRxInactivity++;
1897
if (pContext->Counters.nRxInactivity >= 10)
1899
//#define CRASH_ON_NO_RX
1900
#if defined(CRASH_ON_NO_RX)
1901
ONPAUSECOMPLETEPROC proc = (ONPAUSECOMPLETEPROC)(PVOID)1;
1908
pContext->Counters.nRxInactivity = 0;
1909
pContext->Counters.prevIn = pContext->Statistics.ifHCInOctets;
1881
1911
return bReportHang;
2033
2063
pContext->NetSendQueue->vq_ops->enable_interrupt(pContext->NetSendQueue, b);
2034
2064
if (interruptSource & isReceive)
2035
2065
pContext->NetReceiveQueue->vq_ops->enable_interrupt(pContext->NetReceiveQueue, b);
2066
ParaNdis_DebugHistory(pContext, hopDPC, (PVOID)0x10, interruptSource, b, 0);
2038
2069
/**********************************************************