26 OpMode = Adapter->OpMode;
43 OpMode = Adapter->OpMode;
47 for (
i = 0;
i < 5000; ++
i)
60 WARN(
"Failed to stop the TX/RX process 0x%08lx\n",
Status);
73 Data = Adapter->SiaSetting;
76 Adapter->SiaSetting =
Data;
95 ULONG SiaConn, SiaGen;
97 TRACE(
"CSR13 %08lx, CSR14 %08lx, CSR15 %08lx\n", Csr13, Csr14, Csr15);
104 SiaConn = Adapter->AnalogControl;
114 SiaGen = Adapter->SiaSetting;
115 SiaGen &= 0xFFFF0000;
117 Adapter->SiaSetting = SiaGen;
142 Adapter->MediaTestStatus =
FALSE;
145 if (!Adapter->LoopbackFrameSlots)
147 ERR(
"Failed to complete test packets, CSR12 %08lx, CSR5 %08lx\n",
156 --Adapter->LoopbackFrameSlots;
160 Tbd = Adapter->CurrentTbd;
163 Tcb = Adapter->CurrentTcb;
172 Tbd->
Address1 = Adapter->LoopbackFramePhys[FrameNumber];
195 Tbd = Adapter->CurrentTbd;
198 if (Tbd != Adapter->HeadTbd)
214 Tcb = Adapter->CurrentTcb;
223 Tbd->
Address1 = Adapter->SetupFramePhys;
227 if (!WaitForCompletion)
229 if (Adapter->ProgramHashPerfectFilter)
237 if (!WaitForCompletion)
241 for (
i = 50000;
i > 0; --
i)
251 ERR(
"Failed to complete setup frame %08lx\n", Tbd->
Status);
263 PULONG SetupFrame, SetupFrameStart;
269 SetupFrame = Adapter->SetupFrame;
272 MacAddress = (
PUSHORT)Adapter->CurrentMacAddress;
278 SetupFrameStart = Adapter->SetupFrame;
281 *SetupFrame++ = SetupFrameStart[0];
282 *SetupFrame++ = SetupFrameStart[1];
283 *SetupFrame++ = SetupFrameStart[2];
292 PULONG SetupFrame, SetupFrameStart;
296 SetupFrame = Adapter->SetupFrame;
299 MacAddress = (
PUSHORT)Adapter->CurrentMacAddress;
305 for (
i = 0;
i < Adapter->MulticastCount; ++
i)
307 MacAddress = (
PUSHORT)Adapter->MulticastList[
i].MacAddress;
327 SetupFrameStart = Adapter->SetupFrame;
330 *SetupFrame++ = SetupFrameStart[0];
331 *SetupFrame++ = SetupFrameStart[1];
332 *SetupFrame++ = SetupFrameStart[2];
343 PULONG SetupFrame = Adapter->SetupFrame;
350 for (
i = 0;
i < Adapter->MulticastCount; ++
i)
352 MacAddress = (
PUSHORT)Adapter->MulticastList[
i].MacAddress;
357 SetupFrame[
Hash / 16] |= 1 << (
Hash % 16);
364 SetupFrame[
Hash / 16] |= 1 << (
Hash % 16);
368 MacAddress = (
PUSHORT)Adapter->CurrentMacAddress;
383 Adapter->ProgramHashPerfectFilter = UsePerfectFiltering;
384 Adapter->OidPending =
TRUE;
386 if (UsePerfectFiltering)
405 ULONG OpMode, OldPacketFilter;
407 INFO(
"Packet filter value 0x%lx\n", PacketFilter);
412 OpMode = Adapter->OpMode;
422 Adapter->OpMode = OpMode;
427 OldPacketFilter = Adapter->PacketFilter;
428 Adapter->PacketFilter = PacketFilter;
473 Adapter->LinkSpeedMbps = 10;
475 Adapter->MediaNumber = Adapter->DefaultMedia;
487 switch (Adapter->ChipType)
492 Adapter->Media[Adapter->MediaNumber].Csr13,
493 Adapter->Media[Adapter->MediaNumber].Csr14,
494 Adapter->Media[Adapter->MediaNumber].Csr15);
532 if ((Adapter->MediaBitmap & (1 <<
MEDIA_HMR)) && Adapter->HpnaInitBitmap)
547 Adapter->LinkUp =
TRUE;
ULONG DcEthernetCrc(_In_reads_bytes_(Size) const VOID *Buffer, _In_ ULONG Size)
VOID DcPowerSave(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN Enable)
VOID MediaSelectMiiPort(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN ResetPhy)
#define DC_LOOPBACK_FRAMES
VOID MediaMiiSelect(_In_ PDC21X4_ADAPTER Adapter)
FORCEINLINE ULONG DC_READ(_In_ PDC21X4_ADAPTER Adapter, _In_ DC_CSR Register)
VOID DcInitRxRing(_In_ PDC21X4_ADAPTER Adapter)
#define DC_MODE_AUI_FAILED
#define DC_SIA_ANALOG_CONTROL
VOID HpnaPhyInit(_In_ PDC21X4_ADAPTER Adapter)
#define DC_MODE_BNC_FAILED
VOID MediaGprSelect(_In_ PDC21X4_ADAPTER Adapter)
#define DC_MODE_PORT_AUTOSENSE
#define DC_MODE_TEST_PACKET
#define DC_LOOPBACK_FRAME_SIZE
VOID DcInitTxRing(_In_ PDC21X4_ADAPTER Adapter)
#define DC_WRITE(Adapter, Register, Value)
VOID MediaSiaSelect(_In_ PDC21X4_ADAPTER Adapter)
#define DC_MODE_AUTONEG_MASK
#define DC_OPMODE_FULL_DUPLEX
#define DC_OPMODE_TX_ENABLE
#define DC_SETUP_FRAME_PERFECT_FILTER_ADDRESSES
#define DC_OPMODE_RX_PROMISCUOUS
#define DC_SETUP_FRAME_ENTRY(Value)
#define DC_SIA_CONN_RESET
#define DC_STATUS_RX_STATE_MASK
@ DcCsr13_SiaConnectivity
#define DC_TBD_STATUS_OWNED
#define DC_STATUS_TX_STATE_STOPPED
#define DC_TBD_CONTROL_REQUEST_INTERRUPT
#define DC_TBD_CONTROL_SETUP_FRAME
#define DC_TX_POLL_DOORBELL
#define DC_TBD_CONTROL_FIRST_FRAGMENT
#define DC_BUS_MODE_SOFT_RESET
#define DC_OPMODE_RX_ENABLE
#define DC_SETUP_FRAME_BROADCAST_HASH
#define DC_STATUS_RX_STATE_STOPPED
#define DC_TBD_CONTROL_END_OF_RING
#define DC_TBD_CONTROL_LAST_FRAGMENT
#define DC_SETUP_FRAME_SIZE
#define DC_STATUS_TX_STATE_MASK
#define DC_OPMODE_RX_ALL_MULTICAST
#define DC_OPMODE_PORT_SELECT
#define DC_TBD_CONTROL_HASH_PERFECT_FILTER
#define DC_SETUP_FRAME_ADDRESSES
static int Hash(const char *)
VOID DcWriteGpio(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG Value)
NDIS_STATUS DcUpdateMulticastList(_In_ PDC21X4_ADAPTER Adapter)
NDIS_STATUS DcSetupAdapter(_In_ PDC21X4_ADAPTER Adapter)
VOID DcDisableHw(_In_ PDC21X4_ADAPTER Adapter)
VOID DcSetupFrameInitialize(_In_ PDC21X4_ADAPTER Adapter)
NDIS_STATUS DcApplyPacketFilter(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG PacketFilter)
static VOID DcSetupFrameImperfectFiltering(_In_ PDC21X4_ADAPTER Adapter)
VOID DcStopTxRxProcess(_In_ PDC21X4_ADAPTER Adapter)
static VOID DcSoftReset(_In_ PDC21X4_ADAPTER Adapter)
VOID DcWriteSia(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG Csr13, _In_ ULONG Csr14, _In_ ULONG Csr15)
BOOLEAN DcSetupFrameDownload(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN WaitForCompletion)
VOID DcTestPacket(_In_ PDC21X4_ADAPTER Adapter)
static VOID DcSetupFramePerfectFiltering(_In_ PDC21X4_ADAPTER Adapter)
#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 ETH_LENGTH_OF_ADDRESS
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
#define NdisReleaseSpinLock(_SpinLock)
#define NDIS_PACKET_TYPE_PROMISCUOUS
#define NDIS_STATUS_PENDING
#define NDIS_STATUS_MEDIA_CONNECT
#define NdisMIndicateStatusComplete(MiniportAdapterHandle)
#define NDIS_ERROR_CODE_HARDWARE_FAILURE
#define NDIS_PACKET_TYPE_BROADCAST
#define NdisStallExecution
#define NDIS_STATUS_SUCCESS
#define NDIS_PACKET_TYPE_ALL_MULTICAST
#define NdisAcquireSpinLock(_SpinLock)
#define NDIS_STATUS_HARD_ERRORS
#define NdisMIndicateStatus(MiniportAdapterHandle, GeneralStatus, StatusBuffer, StatusBufferSize)
VOID EXPORT NdisMSleep(IN ULONG MicrosecondsToSleep)
#define KeMemoryBarrierWithoutFence()
FORCEINLINE PDC_TBD DC_NEXT_TBD(_In_ PDC21X4_ADAPTER Adapter, _In_ PDC_TBD Tbd)
FORCEINLINE PDC_TCB DC_NEXT_TCB(_In_ PDC21X4_ADAPTER Adapter, _In_ PDC_TCB Tcb)
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_In_ WDF_WMI_PROVIDER_CONTROL Control