aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc/net.h
diff options
context:
space:
mode:
authorMarvin Borner2020-09-21 22:00:40 +0200
committerMarvin Borner2020-09-21 22:00:40 +0200
commit0e9abba93578786e774525dfdf02c59194d3e1e5 (patch)
treee7df565030ebfc4d334ca142e005351ffd293cd6 /kernel/inc/net.h
parent02d97dcb1ea14c963219f22aed24b297e8366d05 (diff)
Frustration
Diffstat (limited to 'kernel/inc/net.h')
-rw-r--r--kernel/inc/net.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/kernel/inc/net.h b/kernel/inc/net.h
index 11b94e5..f3876e9 100644
--- a/kernel/inc/net.h
+++ b/kernel/inc/net.h
@@ -3,9 +3,36 @@
#ifndef NET_H
#define NET_H
+#include <def.h>
+
#define RTL8139_VENDOR_ID 0x10ec
#define RTL8139_DEVICE_ID 0x8139
+#define RTL_PORT_MAC 0x00
+#define RTL_PORT_MAR 0x08
+#define RTL_PORT_TXSTAT 0x10
+#define RTL_PORT_TXBUF 0x20
+#define RTL_PORT_RBSTART 0x30
+#define RTL_PORT_CMD 0x37
+#define RTL_PORT_RXPTR 0x38
+#define RTL_PORT_RXADDR 0x3A
+#define RTL_PORT_IMR 0x3C
+#define RTL_PORT_ISR 0x3E
+#define RTL_PORT_TCR 0x40
+#define RTL_PORT_RCR 0x44
+#define RTL_PORT_RXMISS 0x4C
+#define RTL_PORT_CONFIG 0x52
+
+#define ETHERNET_TYPE_IP 0x0800
+#define ETHERNET_TYPE_ARP 0x0806
+
+struct ethernet_packet {
+ u8 dst_mac_addr[6];
+ u8 src_mac_addr[6];
+ u16 type;
+ u8 data[];
+} __attribute__((packed));
+
void net_install();
#endif