23 TRACE(
"TX underrun\n");
37 Adapter->TransmitUnderruns = 0;
41 OpMode = Adapter->OpMode;
48 INFO(
"New OP Mode %08lx\n", OpMode);
54 INFO(
"Store & Forward\n");
59 Adapter->OpMode = OpMode;
72 WARN(
"Transmit jabber timer timed out\n");
93 ULONG TbdStatus, Collisions;
95 for (Tcb = Adapter->LastTcb;
96 Tcb != Adapter->CurrentTcb;
105 ++Adapter->TcbCompleted;
110 Tbd->
Control &= ~DC_TBD_CONTROL_SETUP_FRAME;
128 ++Adapter->LoopbackFrameSlots;
135 ++Adapter->Statistics.TransmitErrors;
138 ++Adapter->Statistics.TransmitUnderrunErrors;
140 ++Adapter->Statistics.TransmitLateCollisions;
143 ++Adapter->Statistics.TransmitExcessiveCollisions;
145 ++Adapter->Statistics.TransmitLostCarrierSense;
149 ++Adapter->Statistics.TransmitOk;
152 ++Adapter->Statistics.TransmitDeferred;
154 ++Adapter->Statistics.TransmitHeartbeatErrors;
159 ++Adapter->Statistics.TransmitOneRetry;
160 else if (Collisions > 1)
161 ++Adapter->Statistics.TransmitMoreCollisions;
169 Adapter->LastTcb = Tcb;
180 TRACE(
"Handle TX\n");
210 TRACE(
"SP completed\n");
212 Adapter->OidPending =
FALSE;
225 OpMode = Adapter->OpMode;
226 OpMode &= ~DC_OPMODE_RX_ENABLE;
229 for (
i = 0;
i < 5000; ++
i)
239 WARN(
"Failed to stop the RX process 0x%08lx\n",
Status);
282 for (
i = 0;
i < PacketsToIndicate; ++
i)
302 PDC_RBD Rbd, StartRbd, LastRbd;
303 ULONG PacketsToIndicate;
306 Rbd = StartRbd = LastRbd = Adapter->CurrentRbd;
307 PacketsToIndicate = 0;
314 ULONG RbdStatus, PacketLength, RxCounters;
330 while (LastRbd != Rbd);
339 ERR(
"RX overflow, dropping the packets\n");
341 Adapter->Statistics.ReceiveOverrunErrors +=
355 ++Adapter->Statistics.ReceiveOverrunErrors;
384 ++Adapter->Statistics.ReceiveErrors;
387 ++Adapter->Statistics.ReceiveOverrunErrors;
392 ++Adapter->Statistics.ReceiveAlignmentErrors;
394 ++Adapter->Statistics.ReceiveCrcErrors;
401 ++Adapter->Statistics.ReceiveOk;
412 TRACE(
"RX packet (len %u), RCB %p\n", PacketLength, Rcb);
422 ++Adapter->Statistics.ReceiveBroadcast;
424 ++Adapter->Statistics.ReceiveMulticast;
428 ++Adapter->Statistics.ReceiveUnicast;
433 ReceiveArray[PacketsToIndicate++] =
Packet;
435 if (Adapter->FreeRcbList.Next)
443 ASSERT(Adapter->RcbFree > 0);
470 Adapter->CurrentRbd = Rbd;
473 if (PacketsToIndicate)
501 ERR(
"%s error occured, CSR5 %08lx\n",
DcDbgBusError(InterruptStatus), InterruptStatus);
517 ULONG InterruptStatus, IoLimit;
578 if (InterruptStatus == 0xFFFFFFFF || !(InterruptStatus & Adapter->
InterruptMask))
600 ULONG InterruptStatus;
618 *InterruptRecognized =
TRUE;
619 *QueueMiniportHandleInterrupt =
TRUE;
623 *InterruptRecognized =
FALSE;
624 *QueueMiniportHandleInterrupt =
FALSE;
#define DC_INTERRUPT_PROCESSING_LIMIT
#define DC_EVENT_SETUP_FRAME_COMPLETED
#define DC_NEED_RX_OVERFLOW_WORKAROUND
#define DC_RECEIVE_ARRAY_SIZE
#define DC_LOOPBACK_FRAMES
struct _DC21X4_ADAPTER * PDC21X4_ADAPTER
FORCEINLINE ULONG DC_READ(_In_ PDC21X4_ADAPTER Adapter, _In_ DC_CSR Register)
VOID DcStopTxRxProcess(_In_ PDC21X4_ADAPTER Adapter)
VOID DcProcessPendingPackets(_In_ PDC21X4_ADAPTER Adapter)
#define DC_TX_UNDERRUN_LIMIT
#define DC_WRITE(Adapter, Register, Value)
#define DC_RBD_STATUS_INVALID
#define DC_RBD_STATUS_FRAME_LENGTH_SHIFT
#define DC_OPMODE_TX_THRESHOLD_LEVEL
#define DC_TBD_STATUS_UNDERFLOW
#define DC_TBD_STATUS_COLLISIONS_MASK
#define DC_STATUS_RX_STATE_MASK
#define DC_TBD_STATUS_RETRY_ERROR
#define DC_TBD_STATUS_OWNED
#define DC_RBD_STATUS_LAST_DESCRIPTOR
#define DC_TBD_CONTROL_REQUEST_INTERRUPT
#define DC_IRQ_ABNORMAL_SUMMARY
#define DC_COUNTER_RX_OVERFLOW_SHIFT
#define DC_IRQ_TX_STOPPED
#define DC_TBD_CONTROL_SETUP_FRAME
#define DC_TX_POLL_DOORBELL
#define DC_RBD_STATUS_DRIBBLE
#define DC_TBD_STATUS_COLLISIONS_SHIFT
#define DC_COUNTER_RX_OVERFLOW_MASK
#define DC_TBD_STATUS_CARRIER_LOST
#define DC_IRQ_RX_STOPPED
#define DC_IRQ_TX_JABBER_TIMEOUT
#define DC_STATUS_RX_STATE_STOPPED
#define DC_OPMODE_TX_THRESHOLD_MAX
#define DC_OPMODE_TX_THRESHOLD_CTRL_MASK
#define DC_RBD_STATUS_FRAME_LENGTH_MASK
#define DC_OPMODE_STORE_AND_FORWARD
#define DC_RBD_STATUS_MULTICAST
#define DC_RBD_STATUS_OVERRUN
#define DC_IRQ_TX_UNDERFLOW
#define DC_TBD_STATUS_DEFFERED
#define DC_IRQ_SYSTEM_ERROR
#define DC_TBD_STATUS_HEARTBEAT_FAIL
#define DC_TBD_STATUS_LATE_COLLISION
#define DC_COUNTER_RX_NO_BUFFER_MASK
#define DC_RBD_STATUS_CRC_ERROR
#define DC_TBD_STATUS_ERROR_SUMMARY
#define DC_RBD_STATUS_OWNED
VOID NTAPI DcReturnPacket(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ PNDIS_PACKET Packet)
static VOID DcHandleRx(_In_ PDC21X4_ADAPTER Adapter)
static VOID DcHandleTxJabberTimeout(_In_ PDC21X4_ADAPTER Adapter)
VOID NTAPI DcIsr(_Out_ PBOOLEAN InterruptRecognized, _Out_ PBOOLEAN QueueMiniportHandleInterrupt, _In_ NDIS_HANDLE MiniportAdapterContext)
static VOID DcHandleTxCompletedFrames(_In_ PDC21X4_ADAPTER Adapter, _Inout_ PLIST_ENTRY SendReadyList, _Out_ PULONG DpcEvents)
static VOID DcHandleRxReceivedFrames(_In_ PDC21X4_ADAPTER Adapter)
VOID NTAPI DcHandleInterrupt(_In_ NDIS_HANDLE MiniportAdapterContext)
static VOID DcHandleSystemError(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG InterruptStatus)
static VOID DcStopRxProcess(_In_ PDC21X4_ADAPTER Adapter)
static VOID DcIndicateReceivePackets(_In_ PDC21X4_ADAPTER Adapter, _In_ PNDIS_PACKET *ReceiveArray, _In_ ULONG PacketsToIndicate)
static VOID DcAdjustTxFifoThreshold(_In_ PDC21X4_ADAPTER Adapter)
static VOID DcHandleTx(_In_ PDC21X4_ADAPTER Adapter)
FORCEINLINE PSINGLE_LIST_ENTRY DcPopEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead)
#define DC_WRITE_BARRIER()
VOID _cdecl NdisWriteErrorLogEntry(IN NDIS_HANDLE NdisAdapterHandle, IN NDIS_ERROR_CODE ErrorCode, IN ULONG NumberOfErrorValues,...)
NDIS_STATUS EXPORT NdisScheduleWorkItem(IN PNDIS_WORK_ITEM pWorkItem)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
long __cdecl _InterlockedCompareExchange(_Interlocked_operand_ long volatile *_Destination, long _Exchange, long _Comparand)
#define NdisMIndicateReceivePacket(MiniportAdapterHandle, ReceivePackets, NumberOfPackets)
#define NdisMSetInformationComplete(MiniportAdapterHandle, Status)
#define NdisReleaseSpinLock(_SpinLock)
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
#define NdisFlushBuffer(Buffer, WriteToDevice)
#define NdisDprReleaseSpinLock(_SpinLock)
#define NDIS_ERROR_CODE_HARDWARE_FAILURE
#define NdisAdjustBufferLength(Buffer, Length)
#define NdisStallExecution
#define NDIS_STATUS_SUCCESS
#define NdisDprAcquireSpinLock(_SpinLock)
#define NDIS_SET_PACKET_STATUS(_Packet, _Status)
#define NdisMSendComplete(MiniportAdapterHandle, Packet, Status)
#define NdisAcquireSpinLock(_SpinLock)
#define NDIS_STATUS_RESOURCES
#define DC_PACKET_FROM_LIST_ENTRY(ListEntry)
#define DC_RBD_FROM_PACKET(Packet)
#define DC_RCB_FROM_PACKET(Packet)
FORCEINLINE PDC_TCB DC_NEXT_TCB(_In_ PDC21X4_ADAPTER Adapter, _In_ PDC_TCB Tcb)
FORCEINLINE PDC_RBD DC_NEXT_RBD(_In_ PDC21X4_ADAPTER Adapter, _In_ PDC_RBD Rbd)
FORCEINLINE PDC_RCB * DC_GET_RCB_SLOT(_In_ PDC21X4_ADAPTER Adapter, _In_ PDC_RBD Rbd)
#define DC_RCB_FLAG_RECLAIM
FORCEINLINE VOID DC_RELEASE_TCB(_In_ PDC21X4_ADAPTER Adapter, _In_ PDC_TCB Tcb)
#define DC_LIST_ENTRY_FROM_PACKET(Packet)
base of all file and directory entries
ULONG CurrentInterruptMask
PMEDIA_HANDLE_LINK_STATE_CHANGE HandleLinkStateChange
ULONG LinkStateChangeMask
DECLSPEC_CACHEALIGN NDIS_SPIN_LOCK ReceiveLock
SINGLE_LIST_ENTRY FreeRcbList
SINGLE_LIST_ENTRY ListEntry
FORCEINLINE VOID PushEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PSINGLE_LIST_ENTRY Entry)
#define ETH_IS_BROADCAST(Address)