VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/E1kNetHw.h

Last change on this file was 89462, checked in by vboxsync, 3 years ago

EFI: Beginnings of a e1000 network driver to support network boot with our e1000 emulation, not built right now.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/** @file
2
3 E1000 hardware interface definitions.
4
5 Copyright (c) 2021, Oracle and/or its affiliates.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8**/
9
10#ifndef _E1K_NET_HW_H_
11#define _E1K_NET_HW_H_
12
13#define INTEL_PCI_VENDOR_ID 0x8086
14#define INTEL_82540EM_PCI_DEVICE_ID 0x100e
15#define INTEL_82543GC_PCI_DEVICE_ID 0x1004
16#define INTEL_82545EM_PCI_DEVICE_ID 0x100f
17
18//
19// Receive descriptor.
20//
21typedef struct {
22 UINT32 AddrBufferLow;
23 UINT32 AddrBufferHigh;
24 UINT16 BufferLength;
25 UINT16 Checksum;
26 UINT8 Status;
27 UINT8 Errors;
28 UINT16 Special;
29} E1K_RX_DESC;
30
31#define E1K_RX_STATUS_DONE BIT0
32#define E1K_RX_STATUS_EOP BIT1
33
34#define E1K_RX_ERROR_CE BIT0
35#define E1K_RX_ERROR_SEQ BIT2
36#define E1K_RX_ERROR_CXE BIT4
37#define E1K_RX_ERROR_RXE BIT7
38
39//
40// Transmit descriptor.
41//
42typedef struct {
43 UINT32 AddrBufferLow;
44 UINT32 AddrBufferHigh;
45 UINT16 BufferLength;
46 UINT8 ChecksumOffset;
47 UINT8 Command;
48 UINT8 Status;
49 UINT8 ChecksumStart;
50 UINT16 Special;
51} E1K_TX_DESC;
52
53#define E1K_TX_CMD_EOP BIT0
54#define E1K_TX_CMD_FCS BIT1
55#define E1K_TX_CMD_RS BIT3
56
57#define E1K_REG_CTRL 0x00000000
58# define E1K_REG_CTRL_ASDE BIT5
59# define E1K_REG_CTRL_SLU BIT6
60# define E1K_REG_CTRL_RST BIT26
61# define E1K_REG_CTRL_PHY_RST BIT31
62#define E1K_REG_STATUS 0x00000008
63# define E1K_REG_STATUS_LU BIT1
64#define E1K_REG_EECD 0x00000010
65#define E1K_REG_EERD 0x00000014
66# define E1K_REG_EERD_START BIT0
67# define E1K_REG_EERD_DONE BIT4
68# define E1K_REG_EERD_DATA_GET(x) (((x) >> 16) & 0xffff)
69#define E1K_REG_ICR 0x000000c0
70#define E1K_REG_ITR 0x000000c4
71#define E1K_REG_ICS 0x000000c8
72#define E1K_REG_IMS 0x000000d0
73#define E1K_REG_IMC 0x000000d8
74#define E1K_REG_RCTL 0x00000100
75# define E1K_REG_RCTL_EN BIT1
76# define E1K_REG_RCTL_MPE BIT4
77# define E1K_REG_RCTL_BSIZE_MASK 0x00030000
78#define E1K_REG_RDBAL 0x00002800
79#define E1K_REG_RDBAH 0x00002804
80#define E1K_REG_RDLEN 0x00002808
81#define E1K_REG_RDH 0x00002810
82#define E1K_REG_RDT 0x00002818
83#define E1K_REG_RDTR 0x00002820
84#define E1K_REG_TCTL 0x00000400
85# define E1K_REG_TCTL_EN BIT1
86# define E1K_REG_TCTL_PSP BIT3
87#define E1K_REG_TIPG 0x00000410
88#define E1K_REG_TDBAL 0x00003800
89#define E1K_REG_TDBAH 0x00003804
90#define E1K_REG_TDLEN 0x00003808
91#define E1K_REG_TDH 0x00003810
92#define E1K_REG_TDT 0x00003818
93#define E1K_REG_RAL 0x00005400
94#define E1K_REG_RAH 0x00005404
95# define E1K_REG_RAH_AV BIT31
96
97//
98// MAC address.
99//
100typedef struct
101{
102 UINT8 Mac[6];
103} E1K_NET_MAC;
104
105#endif // _E1K_NET_HW_H_
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use