22 if (Adapter->LinkUp ==
LinkUp)
27 INFO_VERB(
"Link %sconnected, media is %s\n",
48 Adapter->LastReceiveActivity = (
ULONG)Adapter->Statistics.ReceiveOk;
56 else if (Adapter->MediaBitmap & (1 <<
MEDIA_AUI))
69 ULONG OpMode = Adapter->OpMode;
74 OpMode &= ~DC_OPMODE_FULL_DUPLEX;
77 OpMode &= ~DC_OPMODE_PORT_XMIT_10;
82 if (OpMode == Adapter->OpMode)
85 INFO_VERB(
"Configuring MAC from %u %s-duplex to %u %s-duplex\n",
86 Adapter->LinkSpeedMbps,
89 FullDuplex ?
"full" :
"half");
91 Adapter->LinkSpeedMbps = Speed100 ? 100 : 10;
95 Adapter->OpMode = OpMode;
106 ULONG MiiLinkPartnerAbility, AdvLpa;
110 TRACE(
"MII LPA %04lx\n", MiiLinkPartnerAbility);
112 AdvLpa = Adapter->MiiMedia.Advertising & MiiLinkPartnerAbility;
156 TRACE(
"MII Status %04lx\n", MiiStatus);
200 ULONG MiiControl, MiiAdvertise;
207 MiiControl |= Adapter->MiiControl;
208 MiiAdvertise = Adapter->MiiAdvertising;
221 if (Adapter->ChipType !=
DC21140)
226 OpMode = Adapter->OpMode;
227 OpMode &= ~DC_OPMODE_MEDIA_MASK;
229 Adapter->OpMode = OpMode;
240 if (Adapter->MiiMedia.ResetStreamLength)
243 DcWriteGpio(Adapter, Adapter->MiiMedia.SetupStream[0]);
245 for (
i = 0;
i < Adapter->MiiMedia.ResetStreamLength; ++
i)
257 DcWriteGpio(Adapter, Adapter->MiiMedia.SetupStream[0]);
260 for (
i = 1;
i < Adapter->MiiMedia.SetupStreamLength; ++
i)
277 Media = &Adapter->Media[Adapter->MediaNumber];
281 if (Adapter->ChipType !=
DC21041)
294 OpMode = Adapter->OpMode;
295 OpMode &= ~DC_OPMODE_MEDIA_MASK;
297 Adapter->OpMode = OpMode;
311 Media = &Adapter->Media[Adapter->MediaNumber];
315 OpMode = Adapter->OpMode;
316 OpMode &= ~DC_OPMODE_MEDIA_MASK;
318 Adapter->OpMode = OpMode;
342 Adapter->MiiAdvertising = Adapter->MiiMedia.Advertising;
345 switch (Adapter->ChipType)
350 if (Adapter->RevisionId < 0x20)
376 for (
i = Adapter->DefaultMedia;
i > 0; --
i)
381 Adapter->DefaultMedia =
i;
393 else if (Adapter->MediaBitmap & (1 <<
MEDIA_10T))
433 Adapter->Media[
MEDIA_10T].Csr14 |= Csr14;
458 Adapter->DefaultMedia = MediaNumber;
462 Adapter->InterruptMask &= ~DC_IRQ_LINK_CHANGED;
463 Adapter->LinkStateChangeMask &= ~DC_IRQ_LINK_CHANGED;
474 ULONG MiiAdvertising, MiiControl;
506 Adapter->LinkSpeedMbps = 100;
508 Adapter->LinkSpeedMbps = 10;
510 Adapter->MiiAdvertising = MiiAdvertising;
511 Adapter->MiiControl = MiiControl;
556 switch (Adapter->ChipType)
560 Adapter->Media[
MEDIA_10T].Csr13 = 0x8F01;
561 Adapter->Media[
MEDIA_10T].Csr14 = 0xFFFF;
562 Adapter->Media[
MEDIA_10T].Csr15 = 0x0000;
564 Adapter->Media[
MEDIA_BNC].Csr13 = 0x8F09;
565 Adapter->Media[
MEDIA_BNC].Csr14 = 0x0705;
566 Adapter->Media[
MEDIA_BNC].Csr15 = 0x0006;
577 Adapter->Media[
MEDIA_10T].Csr13 = 0xEF01;
578 Adapter->Media[
MEDIA_10T].Csr14 = 0xFF3F;
579 Adapter->Media[
MEDIA_10T].Csr15 = 0x0008;
581 Adapter->Media[
MEDIA_BNC].Csr13 = 0xEF09;
582 Adapter->Media[
MEDIA_BNC].Csr14 = 0xF7FD;
583 Adapter->Media[
MEDIA_BNC].Csr15 = 0x0006;
585 Adapter->Media[
MEDIA_AUI].Csr13 = 0xEF09;
586 Adapter->Media[
MEDIA_AUI].Csr14 = 0xF7FD;
587 Adapter->Media[
MEDIA_AUI].Csr15 = 0x000E;
609 Adapter->Media[
MEDIA_10T].Csr13 = 0x0001;
610 Adapter->Media[
MEDIA_10T].Csr14 = 0x7F3F;
611 Adapter->Media[
MEDIA_10T].Csr15 = 0x0008;
613 Adapter->Media[
MEDIA_BNC].Csr13 = 0x0009;
614 Adapter->Media[
MEDIA_BNC].Csr14 = 0x0705;
615 Adapter->Media[
MEDIA_BNC].Csr15 = 0x0006;
617 Adapter->Media[
MEDIA_AUI].Csr13 = 0x0009;
618 Adapter->Media[
MEDIA_AUI].Csr14 = 0x0705;
619 Adapter->Media[
MEDIA_AUI].Csr15 = 0x000E;
625 Adapter->Media[
MEDIA_HMR].Csr13 = 0x0009;
626 Adapter->Media[
MEDIA_HMR].Csr14 = 0x0505;
627 Adapter->Media[
MEDIA_HMR].Csr15 = 0x0010;
VOID DcWriteGpio(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG Value)
#define DC_MODE_AUI_FAILED
VOID DcStopTxRxProcess(_In_ PDC21X4_ADAPTER Adapter)
#define DC_MODE_BNC_FAILED
BOOLEAN MiiRead(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG PhyAddress, _In_ ULONG RegAddress, _Out_ PULONG Data)
VOID DcWriteSia(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG Csr13, _In_ ULONG Csr14, _In_ ULONG Csr15)
#define DC_MODE_TEST_PACKET
#define DC_WRITE(Adapter, Register, Value)
BOOLEAN MiiWrite(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG PhyAddress, _In_ ULONG RegAddress, _In_ ULONG Data)
#define MII_SR_AUTONEG_COMPLETE
#define DC_SIA_TXRX_ADV_100TX_FD
#define DC_SIA_TXRX_ADV_10T_HD
#define DC_OPMODE_FULL_DUPLEX
#define MII_AUTONEG_ADVERTISE
#define DC_SIA_TXRX_ADV_100TX_HD
#define MII_CR_POWER_DOWN
#define MII_CR_FULL_DUPLEX
#define MII_SR_LINK_STATUS
#define MII_CR_AUTONEG_RESTART
#define DC_OPMODE_PORT_HEARTBEAT_DISABLE
#define DC_OPMODE_PORT_PCS
#define DC_OPMODE_PORT_XMIT_10
#define DC_SIA_TXRX_AUTONEG
#define DC_SIA_TXRX_ADV_100T4
#define MII_AUTONEG_LINK_PARTNER
#define DC_OPMODE_PORT_SELECT
#define MII_CR_SPEED_SELECTION
#define KeGetCurrentIrql()
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
unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask)
#define NDIS_STATUS_MEDIA_CONNECT
#define NdisMIndicateStatusComplete(MiniportAdapterHandle)
#define NdisDprReleaseSpinLock(_SpinLock)
#define NDIS_STATUS_MEDIA_DISCONNECT
#define NdisStallExecution
#define NdisDprAcquireSpinLock(_SpinLock)
#define NdisMIndicateStatus(MiniportAdapterHandle, GeneralStatus, StatusBuffer, StatusBufferSize)
VOID EXPORT NdisMSleep(IN ULONG MicrosecondsToSleep)