28 for (
j = 8;
j > 0;
j--)
31 Crc = (Crc >> 1) ^ (-(
LONG)(Crc & 1) & 0xEDB88320);
53 for (Tcb = Adapter->LastTcb;
54 Tcb != Adapter->CurrentTcb;
66 Adapter->CurrentTcb = Tcb;
99 if (Adapter->RcbFree != Adapter->RcbCount)
101 INFO(
"RX packets: %u/%u\n", Adapter->RcbFree, Adapter->RcbCount);
110 RxStopped = (Adapter->RcbFree == Adapter->RcbCount);
134 Adapter->Flags &= ~DC_ACTIVE;
158 if (Adapter->OidPending)
162 Adapter->OidPending =
FALSE;
196 ULONG InterruptStatus;
207 if (InterruptStatus == 0xFFFFFFFF)
209 ERR(
"Hardware is gone...\n");
239 if (ResetReason == 1)
295 WARN(
"Transmit timeout, CSR12 %08lx, CSR5 %08lx\n",
376 Characteristics.MajorNdisVersion = NDIS_MINIPORT_MAJOR_VERSION;
377 Characteristics.MinorNdisVersion = NDIS_MINIPORT_MINOR_VERSION;
379 Characteristics.HaltHandler =
DcHalt;
382 Characteristics.ISRHandler =
DcIsr;
384 Characteristics.ResetHandler =
DcReset;
389 Characteristics.AdapterShutdownHandler =
DcShutdown;
NDIS_STATUS EXPORT NdisMRemoveMiniport(IN NDIS_HANDLE MiniportAdapterHandle)
static VOID NTAPI DcShutdown(_In_ NDIS_HANDLE MiniportAdapterContext)
static VOID DcFlushTransmitQueue(_In_ PDC21X4_ADAPTER Adapter)
VOID DcStartAdapter(_In_ PDC21X4_ADAPTER Adapter)
VOID NTAPI DcTransmitTimeoutRecoveryWorker(_In_ PNDIS_WORK_ITEM WorkItem, _In_opt_ PVOID Context)
ULONG DcEthernetCrc(_In_reads_bytes_(Size) const VOID *Buffer, _In_ ULONG Size)
static VOID NTAPI DcHalt(_In_ NDIS_HANDLE MiniportAdapterContext)
DECLSPEC_NOINLINE VOID DcStopAdapter(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN WaitForPackets)
static VOID DcStopReceivePath(_In_ PDC21X4_ADAPTER Adapter)
static NDIS_STATUS NTAPI DcReset(_Out_ PBOOLEAN AddressingReset, _In_ NDIS_HANDLE MiniportAdapterContext)
VOID NTAPI DcResetWorker(_In_ PNDIS_WORK_ITEM WorkItem, _In_opt_ PVOID Context)
static BOOLEAN NTAPI DcCheckForHang(_In_ NDIS_HANDLE MiniportAdapterContext)
VOID NTAPI DcReturnPacket(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ PNDIS_PACKET Packet)
LIST_ENTRY SRompAdapterList
NDIS_STATUS DcSetupAdapter(_In_ PDC21X4_ADAPTER Adapter)
VOID DcDisableHw(_In_ PDC21X4_ADAPTER Adapter)
struct _DC21X4_ADAPTER * PDC21X4_ADAPTER
VOID NTAPI DcCancelSendPackets(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ PVOID CancelId)
VOID NTAPI DcIsr(_Out_ PBOOLEAN InterruptRecognized, _Out_ PBOOLEAN QueueMiniportHandleInterrupt, _In_ NDIS_HANDLE MiniportAdapterContext)
FORCEINLINE ULONG DC_READ(_In_ PDC21X4_ADAPTER Adapter, _In_ DC_CSR Register)
VOID DcStopTxRxProcess(_In_ PDC21X4_ADAPTER Adapter)
#define DC_TRANSMIT_BLOCKS
VOID NTAPI DcHandleInterrupt(_In_ NDIS_HANDLE MiniportAdapterContext)
VOID DcFreeAdapter(_In_ __drv_freesMem(Mem) PDC21X4_ADAPTER Adapter)
NDIS_STATUS NTAPI DcInitialize(_Out_ PNDIS_STATUS OpenErrorStatus, _Out_ PUINT SelectedMediumIndex, _In_ PNDIS_MEDIUM MediumArray, _In_ UINT MediumArraySize, _In_ NDIS_HANDLE MiniportAdapterHandle, _In_ NDIS_HANDLE WrapperConfigurationContext)
#define DC_WRITE(Adapter, Register, Value)
NDIS_STATUS NTAPI DcSetInformation(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ NDIS_OID Oid, _In_ PVOID InformationBuffer, _In_ ULONG InformationBufferLength, _Out_ PULONG BytesRead, _Out_ PULONG BytesNeeded)
NDIS_STATUS NTAPI DcQueryInformation(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ NDIS_OID Oid, _In_ PVOID InformationBuffer, _In_ ULONG InformationBufferLength, _Out_ PULONG BytesWritten, _Out_ PULONG BytesNeeded)
VOID NTAPI DcSendPackets(_In_ NDIS_HANDLE MiniportAdapterContext, _In_ PPNDIS_PACKET PacketArray, _In_ UINT NumberOfPackets)
#define DC_OPMODE_TX_ENABLE
#define DC_TX_POLL_DOORBELL
#define DC_OPMODE_RX_ENABLE
DRIVER_INITIALIZE DriverEntry
NDIS_STATUS EXPORT NdisScheduleWorkItem(IN PNDIS_WORK_ITEM pWorkItem)
VOID EXPORT NdisMSetTimer(IN PNDIS_MINIPORT_TIMER Timer, IN UINT MillisecondsToDelay)
VOID EXPORT NdisMCancelTimer(IN PNDIS_MINIPORT_TIMER Timer, OUT PBOOLEAN TimerCancelled)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define KeGetCurrentIrql()
#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
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 GLint GLint j
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
long __cdecl _InterlockedCompareExchange(_Interlocked_operand_ long volatile *_Destination, long _Exchange, long _Comparand)
#define NdisMSetInformationComplete(MiniportAdapterHandle, Status)
#define NdisReleaseSpinLock(_SpinLock)
#define NDIS_STATUS_PENDING
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
#define NdisMIndicateStatusComplete(MiniportAdapterHandle)
#define NdisDprReleaseSpinLock(_SpinLock)
#define NdisMResetComplete(MiniportAdapterHandle, Status, AddressingReset)
#define NDIS_STATUS_MEDIA_DISCONNECT
#define NDIS_STATUS_FAILURE
#define NDIS_STATUS_SUCCESS
#define NdisDprAcquireSpinLock(_SpinLock)
#define NdisMInitializeWrapper(NdisWrapperHandle, SystemSpecific1, SystemSpecific2, SystemSpecific3)
#define NdisMSendComplete(MiniportAdapterHandle, Packet, Status)
#define NdisAcquireSpinLock(_SpinLock)
#define NDIS_STATUS_HARD_ERRORS
#define NDIS_STATUS_RESET_IN_PROGRESS
#define NdisMIndicateStatus(MiniportAdapterHandle, GeneralStatus, StatusBuffer, StatusBufferSize)
_Out_ _At_ TimerCancelled PBOOLEAN TimerCancelled
VOID EXPORT NdisMSleep(IN ULONG MicrosecondsToSleep)
NDIS_STATUS EXPORT NdisMRegisterMiniport(IN NDIS_HANDLE NdisWrapperHandle, IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, IN UINT CharacteristicsLength)
VOID EXPORT NdisTerminateWrapper(IN NDIS_HANDLE NdisWrapperHandle, IN PVOID SystemSpecific)
#define _In_reads_bytes_(s)
#define DECLSPEC_NOINLINE
#define UNREFERENCED_PARAMETER(P)
#define DC_PACKET_FROM_LIST_ENTRY(ListEntry)
FORCEINLINE PDC_TCB DC_NEXT_TCB(_In_ PDC21X4_ADAPTER Adapter, _In_ PDC_TCB Tcb)
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
DECLSPEC_CACHEALIGN NDIS_SPIN_LOCK ModeLock
_Interlocked_ volatile LONG ResetLock
NDIS_WORK_ITEM ResetWorkItem
NDIS_HANDLE AdapterHandle
NDIS_WORK_ITEM TxRecoveryWorkItem
DECLSPEC_CACHEALIGN NDIS_SPIN_LOCK SendLock
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem