#include "dc21x4.h"
#include <debug.h>
Go to the source code of this file.
|
static VOID | Media143SelectNextSerialMedia (_In_ PDC21X4_ADAPTER Adapter) |
|
static VOID | Media143SelectNextMedia (_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG SiaStatus) |
|
static VOID | Media143Handle10LinkFail (_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG SiaStatus) |
|
static VOID | Media143Handle10LinkPass (_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG SiaStatus) |
|
static VOID | Media143Handle100LinkChange (_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG SiaStatus) |
|
static VOID | Media143HandleNWayComplete (_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG SiaStatus) |
|
VOID | MediaLinkStateChange21143 (_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG InterruptStatus) |
|
static BOOLEAN | Media143CheckLink (_In_ PDC21X4_ADAPTER Adapter, _In_ ULONG SiaStatus) |
|
static VOID | MediaMonitor143 (_In_ PDC21X4_ADAPTER Adapter) |
|
VOID NTAPI | MediaMonitor21143Dpc (_In_ PVOID SystemSpecific1, _In_ PVOID FunctionContext, _In_ PVOID SystemSpecific2, _In_ PVOID SystemSpecific3) |
|
◆ Media143CheckLink()
Definition at line 336 of file media143.c.
339{
341 {
344 }
345 else
346 {
347
350
353 }
354
356}
#define DC_SIA_STATUS_ANS_AUTONEG_COMPLETE
#define DC_SIA_STATUS_ANS_MASK
#define DC_SIA_STATUS_100T_LINK_FAIL
#define DC_SIA_STATUS_10T_LINK_FAIL
Referenced by MediaMonitor143().
◆ Media143Handle100LinkChange()
Definition at line 168 of file media143.c.
171{
173
174 INFO_VERB(
"Link changed, CSR12 %08lx\n", SiaStatus);
175
177
179 {
181 }
182 else
183 {
184
186 {
188 }
189 else
190 {
191
192 }
193 }
194}
VOID MediaIndicateConnect(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN LinkUp)
Referenced by MediaLinkStateChange21143().
◆ Media143Handle10LinkFail()
◆ Media143Handle10LinkPass()
Definition at line 138 of file media143.c.
141{
142 INFO_VERB(
"Link passed, CSR12 %08lx\n", SiaStatus);
143
144
146 {
147
149 {
152
153
154 Adapter->ModeFlags &= ~DC_MODE_AUTONEG_MASK;
157 }
158 }
159 else
160 {
161
163 }
164}
#define DC_MODE_AUTONEG_WAIT_INTERRUPT
VOID MediaSiaSelect(_In_ PDC21X4_ADAPTER Adapter)
VOID EXPORT NdisMSetTimer(IN PNDIS_MINIPORT_TIMER Timer, IN UINT MillisecondsToDelay)
Referenced by MediaLinkStateChange21143().
◆ Media143HandleNWayComplete()
Definition at line 198 of file media143.c.
201{
202 ULONG MediaNumber, AdvLpa;
203
204
206 {
207 INFO_VERB(
"Auto-negotiation has completed, LPA %08lx ADV %08lx\n",
208 SiaStatus, Adapter->SymAdvertising);
209
212 {
214 }
216 {
218 }
220 {
222 }
224 {
226 }
228 {
230 }
231 else
232 {
234
235
237 return;
238 }
239 }
240 else
241 {
242 INFO_VERB(
"Link partner does not support auto-negotiation, CSR12 %08lx\n", SiaStatus);
243
244
246 {
248 }
250 {
252 }
253 else
254 {
255
257 return;
258 }
259 }
260
261 if (
MEDIA_IS_10T(MediaNumber) && (MediaNumber != Adapter->MediaNumber))
262 {
263
264 Adapter->ModeFlags &= ~DC_MODE_AUTONEG_MASK;
267 }
268 else
269 {
270
271 Adapter->ModeFlags &= ~DC_MODE_AUTONEG_MASK;
274 }
275
276 if (Adapter->MediaNumber != MediaNumber)
277 {
278 Adapter->MediaNumber = MediaNumber;
280 }
281}
#define DC_MODE_AUTONEG_LINK_STATUS_CHECK
#define DC_SIA_STATUS_LP_CODE_WORD_SHIFT
#define DC_SIA_STATUS_LP_AUTONED_SUPPORTED
Referenced by MediaLinkStateChange21143().
◆ Media143SelectNextMedia()
Definition at line 64 of file media143.c.
67{
68 ULONG MediaBitmap, MediaNumber;
69
71
72 MediaBitmap = Adapter->MediaBitmap;
73
75 {
77 }
79 {
81 {
83 }
84 else
85 {
87 }
88 }
90 {
92 }
94 {
96 }
97 else
98 {
100 }
101
102 Adapter->ModeFlags &= ~DC_MODE_AUTONEG_MASK;
105
106 if (Adapter->MediaNumber != MediaNumber)
107 {
108 Adapter->MediaNumber = MediaNumber;
110 }
111
115 Adapter->LastReceiveActivity = (
ULONG)Adapter->Statistics.ReceiveOk;
116}
#define DC_MODE_AUI_FAILED
#define DC_MODE_BNC_FAILED
#define DC_MODE_TEST_PACKET
#define DC_MODE_AUTONEG_NONE
#define DC_SIA_STATUS_AUI_ACTIVITY
Referenced by Media143Handle100LinkChange(), Media143Handle10LinkFail(), Media143HandleNWayComplete(), and MediaMonitor143().
◆ Media143SelectNextSerialMedia()
Definition at line 18 of file media143.c.
20{
22
23 MediaNumber = Adapter->MediaNumber;
24
25
27 {
32
35 {
37
38 if (Adapter->MediaBitmap & (1 << MediaNumber))
39 {
40 Adapter->MediaNumber = MediaNumber;
42 return;
43 }
44 }
45 }
46
48 {
50
54 }
55 else
56 {
59 }
60}
VOID MediaSelectMiiPort(_In_ PDC21X4_ADAPTER Adapter, _In_ BOOLEAN ResetPhy)
VOID MediaMiiSelect(_In_ PDC21X4_ADAPTER Adapter)
VOID DcStopTxRxProcess(_In_ PDC21X4_ADAPTER Adapter)
Referenced by MediaMonitor21143Dpc().
◆ MediaLinkStateChange21143()
Definition at line 284 of file media143.c.
287{
289
290 INFO_VERB(
"Link interrupt, CSR5 %08lx\n", InterruptStatus);
291
293
294
296 {
298 return;
299 }
300
302
304 {
305
307 }
309 {
311 {
312
314 }
315 else
316 {
317
319 }
320 }
321 else
322 {
323
325 {
326
328 }
329 }
330
332}
FORCEINLINE ULONG DC_READ(_In_ PDC21X4_ADAPTER Adapter, _In_ DC_CSR Register)
#define DC_MODE_AUTONEG_MASK
#define DC_IRQ_LINK_CHANGED
#define DC_SIA_TXRX_AUTONEG
#define NdisDprReleaseSpinLock(_SpinLock)
#define NdisDprAcquireSpinLock(_SpinLock)
◆ MediaMonitor143()
Definition at line 360 of file media143.c.
362{
365
367
369 {
371 {
372
374 break;
375 }
376
378 {
379
382 {
383 Adapter->ModeFlags &= ~DC_MODE_AUTONEG_MASK;
385
387 }
388 else
389 {
390
392 }
393 break;
394 }
395
397 {
398 break;
399 }
400
401 default:
404 break;
405 }
406}
Referenced by MediaMonitor21143Dpc().
◆ MediaMonitor21143Dpc()
Definition at line 410 of file media143.c.
415{
419
423
425 return;
426
428
430 {
432 {
434
436
438 break;
439 }
440
444 {
446
448 {
451 {
452
454
456
457 DelayMs = 5000;
458 }
459
461 {
463
464 DelayMs = 3000;
465 }
466 else
467 {
468
472
473 DelayMs = 3000;
474 }
475 }
476 else
477 {
478 Adapter->
ModeFlags &= ~DC_MODE_TEST_PACKET;
479
481
483
484
486 {
488
489 DelayMs = 3000;
490 }
491 else
492 {
493 DelayMs = 5000;
494 }
495 }
497
499 break;
500 }
501
502 default:
503 {
505 break;
506 }
507 }
508
510}
BOOLEAN MediaMiiCheckLink(_In_ PDC21X4_ADAPTER Adapter)
#define DC_WRITE(Adapter, Register, Value)
VOID DcTestPacket(_In_ PDC21X4_ADAPTER Adapter)
_In_ PVOID _In_ PVOID SystemSpecific2
_In_ PVOID FunctionContext
_In_ PVOID _In_ PVOID _In_ PVOID SystemSpecific3
static NTSTATUS ReceiveActivity(PAFD_FCB FCB, PIRP Irp)
#define UNREFERENCED_PARAMETER(P)
volatile LONG MediaTestStatus
DECLSPEC_CACHEALIGN NDIS_SPIN_LOCK ModeLock
ULONG LastReceiveActivity
NDIS_MINIPORT_TIMER MediaMonitorTimer
DECLSPEC_CACHEALIGN NDIS_SPIN_LOCK SendLock