ReactOS
0.4.16-dev-21-g2af6fd4
eeprom.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: EEPROM specific definitions
5
* COPYRIGHT: Copyright 2023 Dmitry Borisov <di.sean@protonmail.com>
6
*/
7
8
#pragma once
9
10
#include <pshpack1.h>
11
typedef
struct
_DC_SROM_COMPACT_BLOCK
12
{
13
USHORT
SelectedConnectionType
;
14
UCHAR
GpioDirection
;
/* 21140 only */
15
UCHAR
BlockCount
;
16
}
DC_SROM_COMPACT_BLOCK
, *
PDC_SROM_COMPACT_BLOCK
;
17
#include <poppack.h>
18
19
typedef
struct
_DC_SROM_REPAIR_ENTRY
20
{
21
#if DBG
22
PCSTR
Name
;
23
#endif
24
PUCHAR
InfoLeaf
;
25
ULONG
Length
;
26
}
DC_SROM_REPAIR_ENTRY
, *
PDC_SROM_REPAIR_ENTRY
;
27
28
typedef
struct
_DC_SROM_ENTRY
29
{
30
LIST_ENTRY
ListEntry
;
31
ULONG
BusNumber
;
32
DC_CHIP_TYPE
ChipType
;
33
UCHAR
DeviceNumber
;
34
ULONG
InterruptLevel
;
35
ULONG
InterruptVector
;
36
ULONG
DeviceBitmap
;
37
UCHAR
SRomImage
[
ANYSIZE_ARRAY
];
38
}
DC_SROM_ENTRY
, *
PDC_SROM_ENTRY
;
39
40
#define SRomIsBlockExtended(Byte) ((Byte) & 0x80)
41
#define SRomGetExtendedBlockLength(Byte) (((Byte) & 0x7F) + 1)
42
#define SRomGetMediaCode(Byte) ((Byte) & 0x3F)
43
#define SRomBlockHasExtendedData(Byte) ((Byte) & 0x40)
44
#define SRomIsDefaultMedia(Word) ((Word) & 0x4000)
45
#define SRomMediaHasActivityIndicator(Word) (((Word) & 0x8000) == 0)
46
#define SRomMediaActivityIsActiveLow(Word) ((Word) & 0x80)
47
#define SRomMediaGetSenseMask(Word) (1 << (((Word) & 0x0E) >> 1))
48
#define SRomCommandToOpMode(Word) (((Word) & 0x71) << 18)
49
#define SRomMediaAutoSense(Media) ((Media) & 0x800)
50
#define SRomMediaToMediaNumber(Word) ((Word) & 0x1F)
51
#define SRomHmrRegAddress(Byte) ((Byte) & 0x1F)
52
53
#define SROM_OPMODE_MASK \
54
(DC_OPMODE_PORT_SELECT | \
55
DC_OPMODE_PORT_XMIT_10 | \
56
DC_OPMODE_PORT_PCS | \
57
DC_OPMODE_PORT_SCRAMBLER)
58
59
#define EE_SIZE 128
60
#define EAR_SIZE 32
61
62
#define EAR_TEST_PATTERN 0xAA5500FFAA5500FFULL
63
64
#define EEPROM_CMD_WRITE 5
65
#define EEPROM_CMD_READ 6
66
#define EEPROM_CMD_ERASE 7
67
68
#define EEPROM_CMD_LENGTH 3
69
70
/*
71
* Various offsets in the SROM
72
*/
73
#define SROM_VERSION 18
74
#define SROM_CONTROLLER_COUNT 19
75
#define SROM_MAC_ADDRESS 20
76
#define SROM_DEVICE_NUMBER(n) (26 + ((n) * 3))
77
#define SROM_LEAF_OFFSET(n) (27 + ((n) * 3))
78
#define SROM_CHECKSUM_V1 126
79
#define SROM_CHECKSUM_V2 94
80
81
/*
82
* SROM compact and extended format types
83
*/
84
#define SROM_BLOCK_TYPE_GPR 0
85
#define SROM_BLOCK_TYPE_MII_1 1
86
#define SROM_BLOCK_TYPE_SIA 2
87
#define SROM_BLOCK_TYPE_MII_2 3
88
#define SROM_BLOCK_TYPE_SYM 4
89
#define SROM_BLOCK_TYPE_RESET 5
90
#define SROM_BLOCK_TYPE_PHY_SHUTDOWN 6
91
#define SROM_BLOCK_TYPE_HOMERUN 7
92
93
#define SROM_MAX_STREAM_REGS 6
94
95
/*
96
* SROM media codes
97
*/
98
#define SROM_MEDIA_10T 0
99
#define SROM_MEDIA_BNC 1
100
#define SROM_MEDIA_AUI 2
101
#define SROM_MEDIA_100T_HD 3
102
#define SROM_MEDIA_10T_FD 4
103
#define SROM_MEDIA_100TX_FD 5
104
#define SROM_MEDIA_100T4 6
105
#define SROM_MEDIA_100FX_HD 7
106
#define SROM_MEDIA_100FX_FD 8
107
#define SROM_MEDIA_MAX 8
108
#define SROM_MEDIA_HMR 18
Name
struct NameRec_ * Name
Definition:
cdprocs.h:460
DC_CHIP_TYPE
enum _DC_CHIP_TYPE DC_CHIP_TYPE
PDC_SROM_COMPACT_BLOCK
struct _DC_SROM_COMPACT_BLOCK * PDC_SROM_COMPACT_BLOCK
DC_SROM_COMPACT_BLOCK
struct _DC_SROM_COMPACT_BLOCK DC_SROM_COMPACT_BLOCK
DC_SROM_ENTRY
struct _DC_SROM_ENTRY DC_SROM_ENTRY
PDC_SROM_ENTRY
struct _DC_SROM_ENTRY * PDC_SROM_ENTRY
DC_SROM_REPAIR_ENTRY
struct _DC_SROM_REPAIR_ENTRY DC_SROM_REPAIR_ENTRY
PDC_SROM_REPAIR_ENTRY
struct _DC_SROM_REPAIR_ENTRY * PDC_SROM_REPAIR_ENTRY
USHORT
unsigned short USHORT
Definition:
pedump.c:61
_DC_SROM_COMPACT_BLOCK
Definition:
eeprom.h:12
_DC_SROM_COMPACT_BLOCK::GpioDirection
UCHAR GpioDirection
Definition:
eeprom.h:14
_DC_SROM_COMPACT_BLOCK::SelectedConnectionType
USHORT SelectedConnectionType
Definition:
eeprom.h:13
_DC_SROM_COMPACT_BLOCK::BlockCount
UCHAR BlockCount
Definition:
eeprom.h:15
_DC_SROM_ENTRY
Definition:
eeprom.h:29
_DC_SROM_ENTRY::DeviceNumber
UCHAR DeviceNumber
Definition:
eeprom.h:33
_DC_SROM_ENTRY::ChipType
DC_CHIP_TYPE ChipType
Definition:
eeprom.h:32
_DC_SROM_ENTRY::ListEntry
LIST_ENTRY ListEntry
Definition:
eeprom.h:30
_DC_SROM_ENTRY::InterruptVector
ULONG InterruptVector
Definition:
eeprom.h:35
_DC_SROM_ENTRY::InterruptLevel
ULONG InterruptLevel
Definition:
eeprom.h:34
_DC_SROM_ENTRY::BusNumber
ULONG BusNumber
Definition:
eeprom.h:31
_DC_SROM_ENTRY::SRomImage
UCHAR SRomImage[ANYSIZE_ARRAY]
Definition:
eeprom.h:37
_DC_SROM_ENTRY::DeviceBitmap
ULONG DeviceBitmap
Definition:
eeprom.h:36
_DC_SROM_REPAIR_ENTRY
Definition:
eeprom.h:20
_DC_SROM_REPAIR_ENTRY::Length
ULONG Length
Definition:
eeprom.h:25
_DC_SROM_REPAIR_ENTRY::InfoLeaf
PUCHAR InfoLeaf
Definition:
eeprom.h:24
_LIST_ENTRY
Definition:
typedefs.h:120
ANYSIZE_ARRAY
#define ANYSIZE_ARRAY
Definition:
typedefs.h:46
PCSTR
const char * PCSTR
Definition:
typedefs.h:52
PUCHAR
unsigned char * PUCHAR
Definition:
typedefs.h:53
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
UCHAR
unsigned char UCHAR
Definition:
xmlstorage.h:181
drivers
network
dd
dc21x4
eeprom.h
Generated on Sun Sep 15 2024 06:05:34 for ReactOS by
1.9.6