ReactOS 0.4.16-dev-311-g9382aa2
media.h
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 support header file
5 * COPYRIGHT: Copyright 2023 Dmitry Borisov <di.sean@protonmail.com>
6 */
7
8#pragma once
9
10typedef struct _DC_MEDIA
11{
13
16
17 union
18 {
19 struct _DC_MEDIA_SIA_DATA
20 {
24 };
25
26 struct _DC_MEDIA_GPR_DATA
27 {
30 };
31 };
33
34typedef struct _DC_MII_MEDIA
35{
39 USHORT SetupStream[SROM_MAX_STREAM_REGS + 1]; // +1 for GPIO direction (21140)
42
43/*
44 * SROM-defined media values
45 */
46#define MEDIA_10T 0
47#define MEDIA_BNC 1
48#define MEDIA_AUI 2
49#define MEDIA_100TX_HD 3
50#define MEDIA_10T_HD MEDIA_100TX_HD /* 21041 only */
51#define MEDIA_10T_FD 4
52#define MEDIA_100TX_FD 5
53#define MEDIA_100T4 6
54#define MEDIA_100FX_HD 7
55#define MEDIA_100FX_FD 8
56#define MEDIA_HMR 9
57#define MEDIA_LIST_MAX 10
58
59/*
60 * Registry configuration
61 */
62#define MEDIA_AUTO MEDIA_LIST_MAX
63
64/*
65 * Extra codes
66 */
67#define MEDIA_MII MEDIA_LIST_MAX
68#define MEDIA_MAX (MEDIA_LIST_MAX + 1)
69
70#define MEDIA_MII_OVERRIDE_MASK \
71 ((1 << MEDIA_AUI) | \
72 (1 << MEDIA_BNC) | \
73 (1 << MEDIA_100FX_HD) | \
74 (1 << MEDIA_100FX_FD) | \
75 (1 << MEDIA_HMR))
76
77#define MEDIA_FD_MASK \
78 ((1 << MEDIA_10T_FD) | \
79 (1 << MEDIA_100TX_FD) | \
80 (1 << MEDIA_100FX_FD))
81
82#define MEDIA_AUI_BNC_MASK \
83 ((1 << MEDIA_AUI) | \
84 (1 << MEDIA_BNC))
85
86#define MEDIA_10T_MASK \
87 ((1 << MEDIA_10T) | \
88 (1 << MEDIA_10T_FD))
89
90#define MEDIA_100_MASK \
91 ((1 << MEDIA_100TX_HD) | \
92 (1 << MEDIA_100TX_FD) | \
93 (1 << MEDIA_100T4) | \
94 (1 << MEDIA_100FX_HD) | \
95 (1 << MEDIA_100FX_FD))
96
97#define MEDIA_FX_MASK \
98 ((1 << MEDIA_100FX_HD) | \
99 (1 << MEDIA_100FX_FD))
100
101/* Specifying this media code override the default MII selection */
102#define MEDIA_MII_OVERRIDE(MediaNumber) \
103 (((1 << (MediaNumber)) & MEDIA_MII_OVERRIDE_MASK) != 0)
104
105/* Full-duplex media */
106#define MEDIA_IS_FD(MediaNumber) \
107 (((1 << (MediaNumber)) & MEDIA_FD_MASK) != 0)
108
109/* AUI or BNC media */
110#define MEDIA_IS_AUI_BNC(MediaNumber) \
111 (((1 << (MediaNumber)) & MEDIA_AUI_BNC_MASK) != 0)
112
113/* 10Base-T media */
114#define MEDIA_IS_10T(MediaNumber) \
115 (((1 << (MediaNumber)) & MEDIA_10T_MASK) != 0)
116
117/* 100mbps media */
118#define MEDIA_IS_100(MediaNumber) \
119 (((1 << (MediaNumber)) & MEDIA_100_MASK) != 0)
120
121/* 100Base-FX media */
122#define MEDIA_IS_FX(MediaNumber) \
123 (((1 << (MediaNumber)) & MEDIA_FX_MASK) != 0)
124
125/* Forced speed and duplex */
126#define MEDIA_IS_FIXED(Adapter) \
127 (((Adapter)->Flags & DC_AUTOSENSE) == 0)
#define SROM_MAX_STREAM_REGS
Definition: eeprom.h:93
struct _DC_MEDIA DC_MEDIA
struct _DC_MEDIA * PDC_MEDIA
struct _DC_MII_MEDIA * PDC_MII_MEDIA
struct _DC_MII_MEDIA DC_MII_MEDIA
unsigned short USHORT
Definition: pedump.c:61
ULONG Csr14
Definition: media.h:22
USHORT GpioCtrl
Definition: media.h:14
ULONG Csr13
Definition: media.h:21
ULONG LinkMask
Definition: media.h:28
ULONG Polarity
Definition: media.h:29
ULONG Csr15
Definition: media.h:23
ULONG OpMode
Definition: media.h:12
USHORT GpioData
Definition: media.h:15
UCHAR ResetStreamLength
Definition: media.h:37
USHORT Advertising
Definition: media.h:38
UCHAR SetupStreamLength
Definition: media.h:36
USHORT SetupStream[SROM_MAX_STREAM_REGS+1]
Definition: media.h:39
USHORT ResetStream[SROM_MAX_STREAM_REGS]
Definition: media.h:40
uint32_t ULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: xmlstorage.h:181