ReactOS 0.4.15-dev-7674-gc0b4db1
media.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS DC21x4 Driver
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Media common code
5 * COPYRIGHT: Copyright 2023 Dmitry Borisov <di.sean@protonmail.com>
6 */
7
8/* INCLUDES *******************************************************************/
9
10#include "dc21x4.h"
11
12#include <debug.h>
13
14/* FUNCTIONS ******************************************************************/
15
16VOID
18 _In_ PDC21X4_ADAPTER Adapter,
20{
21 /* Nothing to do */
22 if (Adapter->LinkUp == LinkUp)
23 return;
24
25 Adapter->LinkUp = LinkUp;
26
27 INFO_VERB("Link %sconnected, media is %s\n",
28 LinkUp ? "" : "dis",
29 MediaNumber2Str(Adapter, Adapter->MediaNumber));
30
31 NdisDprReleaseSpinLock(&Adapter->ModeLock);
32
33 NdisMIndicateStatus(Adapter->AdapterHandle,
35 NULL,
36 0);
37 NdisMIndicateStatusComplete(Adapter->AdapterHandle);
38
39 NdisDprAcquireSpinLock(&Adapter->ModeLock);
40}
41
42static
45 _In_ PDC21X4_ADAPTER Adapter)
46{
48 Adapter->LastReceiveActivity = (ULONG)Adapter->Statistics.ReceiveOk;
49
50 /*
51 * In MII mode, we don't know exactly which port is active.
52 * Switch to the media with a higher priority.
53 */
54 if (Adapter->MediaBitmap & (1 << MEDIA_HMR))
55 return MEDIA_HMR;
56 else if (Adapter->MediaBitmap & (1 << MEDIA_AUI))
57 return MEDIA_AUI;
58 else
59 return MEDIA_BNC;
60}
61
62static
63VOID
65 _In_ PDC21X4_ADAPTER Adapter,
66 _In_ BOOLEAN FullDuplex,
67 _In_ BOOLEAN Speed100)
68{
69 ULONG OpMode = Adapter->OpMode;
70
71 if (FullDuplex)
72 OpMode |= DC_OPMODE_FULL_DUPLEX;
73 else
74 OpMode &= ~DC_OPMODE_FULL_DUPLEX;
75
76 if (Speed100)
77 OpMode &= ~DC_OPMODE_PORT_XMIT_10;
78 else
79 OpMode |= DC_OPMODE_PORT_XMIT_10;
80
81 /* Nothing to do */
82 if (OpMode == Adapter->OpMode)
83 return;
84
85 INFO_VERB("Configuring MAC from %u %s-duplex to %u %s-duplex\n",
86 Adapter->LinkSpeedMbps,
87 (Adapter->OpMode & DC_OPMODE_FULL_DUPLEX) ? "full" : "half",
88 Speed100 ? 100 : 10,
89 FullDuplex ? "full" : "half");
90
91 Adapter->LinkSpeedMbps = Speed100 ? 100 : 10;
92
93 DcStopTxRxProcess(Adapter);
94
95 Adapter->OpMode = OpMode;
96 DC_WRITE(Adapter, DcCsr6_OpMode, Adapter->OpMode);
97}
98
99static
100VOID
102 _In_ PDC21X4_ADAPTER Adapter,
103 _Out_ PBOOLEAN FullDuplex,
104 _Out_ PBOOLEAN Speed100)
105{
106 ULONG MiiLinkPartnerAbility, AdvLpa;
107
108 MiiRead(Adapter, Adapter->PhyAddress, MII_AUTONEG_LINK_PARTNER, &MiiLinkPartnerAbility);
109
110 TRACE("MII LPA %04lx\n", MiiLinkPartnerAbility);
111
112 AdvLpa = Adapter->MiiMedia.Advertising & MiiLinkPartnerAbility;
113 if (AdvLpa & MII_LP_100T_FD)
114 {
115 *FullDuplex = TRUE;
116 *Speed100 = TRUE;
117 }
118 else if (AdvLpa & MII_LP_100T4)
119 {
120 *FullDuplex = FALSE;
121 *Speed100 = TRUE;
122 }
123 else if (AdvLpa & MII_LP_100T_HD)
124 {
125 *FullDuplex = FALSE;
126 *Speed100 = TRUE;
127 }
128 else if (AdvLpa & MII_LP_10T_FD)
129 {
130 *FullDuplex = TRUE;
131 *Speed100 = FALSE;
132 }
133 else
134 {
135 *FullDuplex = FALSE;
136 *Speed100 = FALSE;
137 }
138}
139
142 _In_ PDC21X4_ADAPTER Adapter)
143{
144 ULONG MiiStatus;
145 BOOLEAN FullDuplex, Speed100;
146
147 /* The link status is a latched-low bit, read it twice */
148 if (!MiiRead(Adapter, Adapter->PhyAddress, MII_STATUS, &MiiStatus))
149 {
150 goto NoLink;
151 }
152 if (!(MiiStatus & MII_SR_LINK_STATUS))
153 {
154 MiiRead(Adapter, Adapter->PhyAddress, MII_STATUS, &MiiStatus);
155 }
156 TRACE("MII Status %04lx\n", MiiStatus);
157
158 /* Check the link status */
159 if (!(MiiStatus & MII_SR_LINK_STATUS))
160 {
161NoLink:
162 /* No link detected, check the other port */
163 if (Adapter->MediaBitmap & ((1 << MEDIA_HMR) | (1 << MEDIA_AUI) | (1 << MEDIA_BNC)))
164 {
165 if ((Adapter->Features & DC_MII_AUTOSENSE) && !MEDIA_IS_FIXED(Adapter))
166 {
167 Adapter->MediaNumber = MediaMiiNextMedia(Adapter);
168 MediaSiaSelect(Adapter);
169 }
170 }
171
172 return FALSE;
173 }
174
175 /* If we are forcing speed and duplex */
176 if (MEDIA_IS_FIXED(Adapter))
177 {
178 FullDuplex = !!(Adapter->MiiControl & MII_CR_FULL_DUPLEX);
179 Speed100 = !!(Adapter->MiiControl & MII_CR_SPEED_SELECTION);
180 }
181 else
182 {
183 /* Check auto-negotiation is complete */
184 if (!(MiiStatus & MII_SR_AUTONEG_COMPLETE))
185 return FALSE;
186
187 MediaMiiGetSpeedAndDuplex(Adapter, &FullDuplex, &Speed100);
188 }
189
190 /* Set the link speed and duplex */
191 MediaMiiSetSpeedAndDuplex(Adapter, FullDuplex, Speed100);
192
193 return TRUE;
194}
195
196VOID
198 _In_ PDC21X4_ADAPTER Adapter)
199{
200 ULONG MiiControl, MiiAdvertise;
201
202 MiiRead(Adapter, Adapter->PhyAddress, MII_CONTROL, &MiiControl);
205 MiiWrite(Adapter, Adapter->PhyAddress, MII_CONTROL, MiiControl);
206
207 MiiControl |= Adapter->MiiControl;
208 MiiAdvertise = Adapter->MiiAdvertising;
209
210 MiiWrite(Adapter, Adapter->PhyAddress, MII_AUTONEG_ADVERTISE, MiiAdvertise | MII_ADV_CSMA);
211 MiiWrite(Adapter, Adapter->PhyAddress, MII_CONTROL, MiiControl);
212}
213
214VOID
216 _In_ PDC21X4_ADAPTER Adapter,
217 _In_ BOOLEAN ResetPhy)
218{
219 ULONG OpMode, i;
220
221 if (Adapter->ChipType != DC21140)
222 {
223 DcWriteSia(Adapter, 0, 0, 0);
224 }
225
226 OpMode = Adapter->OpMode;
227 OpMode &= ~DC_OPMODE_MEDIA_MASK;
229 Adapter->OpMode = OpMode;
230
231 DC_WRITE(Adapter, DcCsr6_OpMode, OpMode);
232
234
235 if (ResetPhy)
236 {
238
239 /* Execute the GPIO reset sequence */
240 if (Adapter->MiiMedia.ResetStreamLength)
241 {
242 /* Set the GPIO direction */
243 DcWriteGpio(Adapter, Adapter->MiiMedia.SetupStream[0]);
244
245 for (i = 0; i < Adapter->MiiMedia.ResetStreamLength; ++i)
246 {
247 NdisMSleep(100);
248 DcWriteGpio(Adapter, Adapter->MiiMedia.ResetStream[i]);
249 }
250
251 /* Give the PHY some time to reset */
252 NdisMSleep(5000);
253 }
254 }
255
256 /* Set the GPIO direction */
257 DcWriteGpio(Adapter, Adapter->MiiMedia.SetupStream[0]);
258
259 /* Execute the GPIO setup sequence */
260 for (i = 1; i < Adapter->MiiMedia.SetupStreamLength; ++i)
261 {
263 DcWriteGpio(Adapter, Adapter->MiiMedia.SetupStream[i]);
264 }
265}
266
267VOID
269 _In_ PDC21X4_ADAPTER Adapter)
270{
271 ULONG OpMode;
272 PDC_MEDIA Media;
273
274 INFO_VERB("Selected media %s\n",
275 MediaNumber2Str(Adapter, Adapter->MediaNumber));
276
277 Media = &Adapter->Media[Adapter->MediaNumber];
278
279 DcStopTxRxProcess(Adapter);
280
281 if (Adapter->ChipType != DC21041)
282 {
283 /* Make sure the reset pulse is wide enough */
285 DcWriteGpio(Adapter, Media->GpioCtrl);
287 DcWriteGpio(Adapter, Media->GpioData);
288 }
289
290 DcWriteSia(Adapter, Media->Csr13, Media->Csr14, Media->Csr15);
291
293
294 OpMode = Adapter->OpMode;
295 OpMode &= ~DC_OPMODE_MEDIA_MASK;
296 OpMode |= Media->OpMode;
297 Adapter->OpMode = OpMode;
298
299 DC_WRITE(Adapter, DcCsr6_OpMode, OpMode);
300}
301
302VOID
304 _In_ PDC21X4_ADAPTER Adapter)
305{
306 ULONG OpMode;
307 PDC_MEDIA Media;
308
309 INFO("Selected media %s\n", MediaNumber2Str(Adapter, Adapter->MediaNumber));
310
311 Media = &Adapter->Media[Adapter->MediaNumber];
312
313 DC_WRITE(Adapter, DcCsr12_Gpio, Media->GpioData);
314
315 OpMode = Adapter->OpMode;
316 OpMode &= ~DC_OPMODE_MEDIA_MASK;
317 OpMode |= Media->OpMode;
318 Adapter->OpMode = OpMode;
319
320 DC_WRITE(Adapter, DcCsr6_OpMode, OpMode);
321}
322
323CODE_SEG("PAGE")
324VOID
326 _In_ PDC21X4_ADAPTER Adapter,
327 _In_ ULONG MediaNumber)
328{
329 ULONG Csr14, MiiAdvertising, MiiControl, i;
330 BOOLEAN UseMii;
331
332 PAGED_CODE();
333
334 /* Media auto-detection */
335 if (MediaNumber == MEDIA_AUTO)
336 {
337 Adapter->Flags |= DC_AUTOSENSE;
338
339 /* Initial value for all boards */
340 Adapter->DefaultMedia = MEDIA_10T;
341
342 Adapter->MiiAdvertising = Adapter->MiiMedia.Advertising;
343 Adapter->MiiControl = MII_CR_AUTONEG | MII_CR_AUTONEG_RESTART;
344
345 switch (Adapter->ChipType)
346 {
347 case DC21041:
348 {
349 /* Errata: don't enable auto-negotiation */
350 if (Adapter->RevisionId < 0x20)
351 break;
352
353 /* Advertise 10T HD and 10T FD. The chip chooses the 10T FD mode automatically */
354 Adapter->Media[MEDIA_10T].Csr14 |= DC_SIA_TXRX_AUTONEG | DC_SIA_TXRX_ADV_10T_HD;
355 Adapter->Media[MEDIA_10T].OpMode |= DC_OPMODE_FULL_DUPLEX;
356 break;
357 }
358
359 case DC21140:
360 {
361 /* Pick the default media */
362 if (Adapter->Features & DC_HAS_MII)
363 {
364 Adapter->DefaultMedia = MEDIA_MII;
365 break;
366 }
367
368 /* The final entry in the media list should be checked first */
369 _BitScanReverse(&Adapter->DefaultMedia, Adapter->MediaBitmap);
370
371 /*
372 * Select the first half-duplex media.
373 * If you want to be able to use 21140 boards without MII in full-duplex mode,
374 * you have to manually select the media.
375 */
376 for (i = Adapter->DefaultMedia; i > 0; --i)
377 {
378 if ((Adapter->MediaBitmap & (1 << i)) && !MEDIA_IS_FD(i))
379 break;
380 }
381 Adapter->DefaultMedia = i;
382 break;
383 }
384
385 case DC21143:
386 case DC21145:
387 {
388 /* Pick the default media */
389 if (Adapter->Features & DC_HAS_MII)
390 {
391 Adapter->DefaultMedia = MEDIA_MII;
392 }
393 else if (Adapter->MediaBitmap & (1 << MEDIA_10T))
394 {
395 /* Start at 10mbps to do internal auto-negotiation */
396 Adapter->DefaultMedia = MEDIA_10T;
397 }
398 else
399 {
400 /* The final entry in the media list should be checked first */
401 _BitScanReverse(&Adapter->DefaultMedia, Adapter->MediaBitmap);
402 }
403
404 /* Enable the PCS function to do 100mbps parallel detection */
405 if (Adapter->SymAdvertising & MII_ADV_100)
406 {
407 Adapter->Media[MEDIA_10T].OpMode |= DC_OPMODE_PORT_PCS;
408 Adapter->Media[MEDIA_10T_FD].OpMode |= DC_OPMODE_PORT_PCS;
409 Adapter->Media[MEDIA_AUI].OpMode |= DC_OPMODE_PORT_PCS;
410 Adapter->Media[MEDIA_BNC].OpMode |= DC_OPMODE_PORT_PCS;
411 Adapter->Media[MEDIA_HMR].OpMode |= DC_OPMODE_PORT_PCS;
412 }
413
414 Csr14 = DC_SIA_TXRX_AUTONEG;
415
416 if (Adapter->SymAdvertising & MII_ADV_10T_HD)
417 Csr14 |= DC_SIA_TXRX_ADV_10T_HD;
418
419 /* When NWay is turned on, the FDX bit advertises 10T FD */
420 if (Adapter->SymAdvertising & MII_ADV_10T_FD)
421 Adapter->Media[MEDIA_10T].OpMode |= DC_OPMODE_FULL_DUPLEX;
422
423 if (Adapter->SymAdvertising & MII_ADV_100T_HD)
425
426 if (Adapter->SymAdvertising & MII_ADV_100T_FD)
428
429 if (Adapter->SymAdvertising & MII_ADV_100T4)
430 Csr14 |= DC_SIA_TXRX_ADV_100T4;
431
432 /* Advertise the PHY capability */
433 Adapter->Media[MEDIA_10T].Csr14 |= Csr14;
434
435 /* This media may use GPIO data different from the 10T HD */
436 Adapter->Media[MEDIA_10T_FD].Csr14 |= Csr14;
437 break;
438 }
439
440 default:
441 break;
442 }
443 }
444 else /* Forced speed and duplex */
445 {
446 UseMii = FALSE;
447
448 if (Adapter->Features & DC_HAS_MII)
449 {
450 if (!MEDIA_MII_OVERRIDE(MediaNumber))
451 {
452 UseMii = TRUE;
453 }
454 }
455
456 if (!UseMii)
457 {
458 Adapter->DefaultMedia = MediaNumber;
459
460 if (MEDIA_IS_10T(MediaNumber))
461 {
462 Adapter->InterruptMask &= ~DC_IRQ_LINK_CHANGED;
463 Adapter->LinkStateChangeMask &= ~DC_IRQ_LINK_CHANGED;
464 }
465
466 if (MEDIA_IS_100(MediaNumber))
467 {
468 Adapter->InterruptMask &= ~(DC_IRQ_LINK_FAIL | DC_IRQ_LINK_PASS);
469 Adapter->LinkStateChangeMask &= ~(DC_IRQ_LINK_FAIL | DC_IRQ_LINK_PASS);
470 }
471 }
472 else
473 {
474 Adapter->DefaultMedia = MEDIA_MII;
475
476 switch (MediaNumber)
477 {
478 case MEDIA_10T:
479 MiiAdvertising = MII_ADV_10T_HD;
480 break;
481 case MEDIA_10T_FD:
482 MiiAdvertising = MII_ADV_10T_FD;
483 MiiControl = MII_CR_FULL_DUPLEX;
484 break;
485 case MEDIA_100TX_HD:
486 MiiAdvertising = MII_ADV_100T_HD;
487 MiiControl = MII_CR_SPEED_SELECTION;
488 break;
489 case MEDIA_100TX_FD:
490 MiiAdvertising = MII_ADV_100T_FD;
492 break;
493 case MEDIA_100T4:
494 MiiAdvertising = MII_ADV_100T4 | MII_CR_SPEED_SELECTION;
495 break;
496
497 default:
498 MiiAdvertising = 0;
499 MiiControl = 0;
500 break;
501 }
502
503 if (MiiControl & MII_CR_SPEED_SELECTION)
504 Adapter->LinkSpeedMbps = 100;
505 else
506 Adapter->LinkSpeedMbps = 10;
507
508 Adapter->MiiAdvertising = MiiAdvertising;
509 Adapter->MiiControl = MiiControl;
510 }
511 }
512
513 INFO("Default media is %s\n", MediaNumber2Str(Adapter, Adapter->DefaultMedia));
514}
515
516static
517CODE_SEG("PAGE")
518VOID
520 _In_ PDC21X4_ADAPTER Adapter)
521{
522 PAGED_CODE();
523
524 Adapter->Media[MEDIA_10T ].OpMode = 0;
525 Adapter->Media[MEDIA_BNC ].OpMode = 0;
526 Adapter->Media[MEDIA_AUI ].OpMode = 0;
527 Adapter->Media[MEDIA_100TX_HD].OpMode = DC_OPMODE_PORT_SELECT |
529 Adapter->Media[MEDIA_10T_FD ].OpMode = DC_OPMODE_FULL_DUPLEX;
532 Adapter->Media[MEDIA_100T4 ].OpMode = DC_OPMODE_PORT_SELECT |
534 Adapter->Media[MEDIA_100FX_HD].OpMode = DC_OPMODE_PORT_SELECT |
540 Adapter->Media[MEDIA_HMR ].OpMode = DC_OPMODE_PORT_HEARTBEAT_DISABLE;
541}
542
543CODE_SEG("PAGE")
544VOID
546 _In_ PDC21X4_ADAPTER Adapter)
547{
548 PAGED_CODE();
549
550 /*
551 * Set the default internal values for the SIA/SYM operating modes.
552 * The SROM parsing code may later overwrite them.
553 */
554 switch (Adapter->ChipType)
555 {
556 case DC21040:
557 {
558 Adapter->Media[MEDIA_10T].Csr13 = 0x8F01;
559 Adapter->Media[MEDIA_10T].Csr14 = 0xFFFF;
560 Adapter->Media[MEDIA_10T].Csr15 = 0x0000;
561
562 Adapter->Media[MEDIA_BNC].Csr13 = 0x8F09;
563 Adapter->Media[MEDIA_BNC].Csr14 = 0x0705;
564 Adapter->Media[MEDIA_BNC].Csr15 = 0x0006;
565
566 Adapter->Media[MEDIA_10T_FD].Csr13 = 0x8F01;
567 Adapter->Media[MEDIA_10T_FD].Csr14 = 0xFFFD;
568 Adapter->Media[MEDIA_10T_FD].Csr15 = 0x0000;
569 Adapter->Media[MEDIA_10T_FD].OpMode = DC_OPMODE_FULL_DUPLEX;
570 break;
571 }
572
573 case DC21041:
574 {
575 Adapter->Media[MEDIA_10T].Csr13 = 0xEF01;
576 Adapter->Media[MEDIA_10T].Csr14 = 0xFF3F;
577 Adapter->Media[MEDIA_10T].Csr15 = 0x0008;
578
579 Adapter->Media[MEDIA_BNC].Csr13 = 0xEF09;
580 Adapter->Media[MEDIA_BNC].Csr14 = 0xF7FD;
581 Adapter->Media[MEDIA_BNC].Csr15 = 0x0006;
582
583 Adapter->Media[MEDIA_AUI].Csr13 = 0xEF09;
584 Adapter->Media[MEDIA_AUI].Csr14 = 0xF7FD;
585 Adapter->Media[MEDIA_AUI].Csr15 = 0x000E;
586
587 Adapter->Media[MEDIA_10T_HD].Csr13 = 0xEF01;
588 Adapter->Media[MEDIA_10T_HD].Csr14 = 0x7F3F;
589 Adapter->Media[MEDIA_10T_HD].Csr15 = 0x0008;
590
591 Adapter->Media[MEDIA_10T_FD].Csr13 = 0xEF01;
592 Adapter->Media[MEDIA_10T_FD].Csr14 = 0x7F3D;
593 Adapter->Media[MEDIA_10T_FD].Csr15 = 0x0008;
594 Adapter->Media[MEDIA_10T_FD].OpMode = DC_OPMODE_FULL_DUPLEX;
595 break;
596 }
597
598 case DC21140:
599 {
600 MediaInitOpMode2114x(Adapter);
601 break;
602 }
603
604 case DC21143:
605 case DC21145:
606 {
607 Adapter->Media[MEDIA_10T].Csr13 = 0x0001;
608 Adapter->Media[MEDIA_10T].Csr14 = 0x7F3F;
609 Adapter->Media[MEDIA_10T].Csr15 = 0x0008;
610
611 Adapter->Media[MEDIA_BNC].Csr13 = 0x0009;
612 Adapter->Media[MEDIA_BNC].Csr14 = 0x0705;
613 Adapter->Media[MEDIA_BNC].Csr15 = 0x0006;
614
615 Adapter->Media[MEDIA_AUI].Csr13 = 0x0009;
616 Adapter->Media[MEDIA_AUI].Csr14 = 0x0705;
617 Adapter->Media[MEDIA_AUI].Csr15 = 0x000E;
618
619 Adapter->Media[MEDIA_10T_FD].Csr13 = 0x0001;
620 Adapter->Media[MEDIA_10T_FD].Csr14 = 0x7F3D;
621 Adapter->Media[MEDIA_10T_FD].Csr15 = 0x0008;
622
623 Adapter->Media[MEDIA_HMR].Csr13 = 0x0009;
624 Adapter->Media[MEDIA_HMR].Csr14 = 0x0505;
625 Adapter->Media[MEDIA_HMR].Csr15 = 0x0010;
626
627 MediaInitOpMode2114x(Adapter);
628 break;
629 }
630
631 default:
632 break;
633 }
634}
#define PAGED_CODE()
unsigned char BOOLEAN
VOID DcWriteGpio(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG Value)
Definition: hardware.c:64
#define DC_MII_AUTOSENSE
Definition: dc21x4.h:116
#define DC_MODE_AUI_FAILED
Definition: dc21x4.h:166
VOID DcStopTxRxProcess(_In_ PDC21X4_ADAPTER Adapter)
Definition: hardware.c:38
#define DC_HAS_MII
Definition: dc21x4.h:113
#define DC_AUTOSENSE
Definition: dc21x4.h:124
#define DC_MODE_BNC_FAILED
Definition: dc21x4.h:167
BOOLEAN MiiRead(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG PhyAddress, _In_ ULONG RegAddress, _Out_ PULONG Data)
Definition: phy.c:101
VOID DcWriteSia(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG Csr13, _In_ ULONG Csr14, _In_ ULONG Csr15)
Definition: hardware.c:89
#define DC_MODE_TEST_PACKET
Definition: dc21x4.h:165
#define DC_WRITE(Adapter, Register, Value)
Definition: dc21x4.h:272
BOOLEAN MiiWrite(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG PhyAddress, _In_ ULONG RegAddress, _In_ ULONG Data)
Definition: phy.c:78
#define MII_STATUS
Definition: dc21x4hw.h:566
#define MII_SR_AUTONEG_COMPLETE
Definition: dc21x4hw.h:568
#define MII_ADV_10T_FD
Definition: dc21x4hw.h:574
#define DC_SIA_TXRX_ADV_100TX_FD
Definition: dc21x4hw.h:471
#define MII_LP_100T_HD
Definition: dc21x4hw.h:583
#define DC_SIA_TXRX_ADV_10T_HD
Definition: dc21x4hw.h:460
#define DC_OPMODE_FULL_DUPLEX
Definition: dc21x4hw.h:327
#define MII_ADV_100T4
Definition: dc21x4hw.h:577
@ DC21145
Definition: dc21x4hw.h:16
@ DC21140
Definition: dc21x4hw.h:14
@ DC21041
Definition: dc21x4hw.h:13
@ DC21040
Definition: dc21x4hw.h:12
@ DC21143
Definition: dc21x4hw.h:15
#define MII_ADV_CSMA
Definition: dc21x4hw.h:572
@ DcCsr6_OpMode
Definition: dc21x4hw.h:180
@ DcCsr12_Gpio
Definition: dc21x4hw.h:187
#define MII_AUTONEG_ADVERTISE
Definition: dc21x4hw.h:571
#define DC_SIA_TXRX_ADV_100TX_HD
Definition: dc21x4hw.h:470
#define MII_CR_POWER_DOWN
Definition: dc21x4hw.h:561
#define MII_CR_RESET
Definition: dc21x4hw.h:565
#define MII_CR_FULL_DUPLEX
Definition: dc21x4hw.h:558
#define MII_CR_AUTONEG
Definition: dc21x4hw.h:562
#define MII_ADV_100
Definition: dc21x4hw.h:596
#define MII_SR_LINK_STATUS
Definition: dc21x4hw.h:567
#define MII_CR_AUTONEG_RESTART
Definition: dc21x4hw.h:559
#define DC_OPMODE_PORT_HEARTBEAT_DISABLE
Definition: dc21x4hw.h:335
#define MII_LP_10T_FD
Definition: dc21x4hw.h:582
#define DC_OPMODE_PORT_PCS
Definition: dc21x4hw.h:338
#define DC_OPMODE_PORT_XMIT_10
Definition: dc21x4hw.h:337
#define DC_SIA_TXRX_AUTONEG
Definition: dc21x4hw.h:461
#define MII_LP_100T_FD
Definition: dc21x4hw.h:584
#define DC_SIA_TXRX_ADV_100T4
Definition: dc21x4hw.h:472
#define DC_IRQ_LINK_PASS
Definition: dc21x4hw.h:271
#define MII_LP_100T4
Definition: dc21x4hw.h:585
#define MII_ADV_100T_HD
Definition: dc21x4hw.h:575
#define MII_AUTONEG_LINK_PARTNER
Definition: dc21x4hw.h:580
#define MII_ADV_100T_FD
Definition: dc21x4hw.h:576
#define MII_CR_ISOLATE
Definition: dc21x4hw.h:560
#define MII_ADV_10T_HD
Definition: dc21x4hw.h:573
#define DC_OPMODE_PORT_SELECT
Definition: dc21x4hw.h:334
#define DC_IRQ_LINK_FAIL
Definition: dc21x4hw.h:281
#define MII_CR_SPEED_SELECTION
Definition: dc21x4hw.h:563
#define MII_CONTROL
Definition: dc21x4hw.h:556
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MediaNumber2Str
Definition: debug.h:93
#define INFO_VERB
Definition: debug.h:90
#define INFO
Definition: debug.h:89
static VOID MediaMiiGetSpeedAndDuplex(_In_ PDC21X4_ADAPTER Adapter, _Out_ PBOOLEAN FullDuplex, _Out_ PBOOLEAN Speed100)
Definition: media.c:101
VOID MediaSelectMiiPort(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN ResetPhy)
Definition: media.c:215
VOID MediaMiiSelect(_In_ PDC21X4_ADAPTER Adapter)
Definition: media.c:197
VOID MediaInitMediaList(_In_ PDC21X4_ADAPTER Adapter)
Definition: media.c:545
static VOID MediaInitOpMode2114x(_In_ PDC21X4_ADAPTER Adapter)
Definition: media.c:519
VOID MediaInitDefaultMedia(_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG MediaNumber)
Definition: media.c:325
static VOID MediaMiiSetSpeedAndDuplex(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN FullDuplex, _In_ BOOLEAN Speed100)
Definition: media.c:64
VOID MediaGprSelect(_In_ PDC21X4_ADAPTER Adapter)
Definition: media.c:303
VOID MediaIndicateConnect(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN LinkUp)
Definition: media.c:17
BOOLEAN MediaMiiCheckLink(_In_ PDC21X4_ADAPTER Adapter)
Definition: media.c:141
VOID MediaSiaSelect(_In_ PDC21X4_ADAPTER Adapter)
Definition: media.c:268
static ULONG MediaMiiNextMedia(_In_ PDC21X4_ADAPTER Adapter)
Definition: media.c:44
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
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
Definition: glfuncs.h:248
unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask)
Definition: intrin_arm.h:180
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
if(dx< 0)
Definition: linetemp.h:194
#define MEDIA_AUI
Definition: media.h:48
#define MEDIA_MII
Definition: media.h:67
#define MEDIA_100TX_FD
Definition: media.h:52
#define MEDIA_10T_HD
Definition: media.h:50
#define MEDIA_IS_FIXED(Adapter)
Definition: media.h:126
#define MEDIA_IS_10T(MediaNumber)
Definition: media.h:114
#define MEDIA_IS_100(MediaNumber)
Definition: media.h:118
#define MEDIA_AUTO
Definition: media.h:62
#define MEDIA_IS_FD(MediaNumber)
Definition: media.h:106
#define MEDIA_100FX_FD
Definition: media.h:55
#define MEDIA_MII_OVERRIDE(MediaNumber)
Definition: media.h:102
#define MEDIA_10T_FD
Definition: media.h:51
#define MEDIA_10T
Definition: media.h:46
#define MEDIA_100FX_HD
Definition: media.h:54
#define MEDIA_HMR
Definition: media.h:56
#define MEDIA_100T4
Definition: media.h:53
#define MEDIA_BNC
Definition: media.h:47
#define MEDIA_100TX_HD
Definition: media.h:49
#define ASSERT(a)
Definition: mode.c:44
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define NDIS_STATUS_MEDIA_CONNECT
Definition: ndis.h:361
#define NdisMIndicateStatusComplete(MiniportAdapterHandle)
Definition: ndis.h:5580
#define NdisDprReleaseSpinLock(_SpinLock)
Definition: ndis.h:4133
#define NDIS_STATUS_MEDIA_DISCONNECT
Definition: ndis.h:362
#define NdisStallExecution
Definition: ndis.h:4453
#define NdisDprAcquireSpinLock(_SpinLock)
Definition: ndis.h:4124
#define NdisMIndicateStatus(MiniportAdapterHandle, GeneralStatus, StatusBuffer, StatusBufferSize)
Definition: ndis.h:5570
VOID EXPORT NdisMSleep(IN ULONG MicrosecondsToSleep)
Definition: miniport.c:2928
@ LinkUp
Definition: srb.h:741
#define TRACE(s)
Definition: solgame.cpp:4
ULONG Csr14
Definition: media.h:22
USHORT GpioCtrl
Definition: media.h:14
ULONG Csr13
Definition: media.h:21
ULONG Csr15
Definition: media.h:23
ULONG OpMode
Definition: media.h:12
USHORT GpioData
Definition: media.h:15
unsigned char * PBOOLEAN
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59